Zananok Posted December 30, 2008 Author Share Posted December 30, 2008 Obviouly a packet of 'addchar' will create the character on the 'Accounts' folder. So i made the login code like the client does, but I can't put them together… I did it 1 time.. but i was to hasty editing to fix the problem that when i realised that i fixed it... it was ruinned again -.-Easy explanation:Need a working (php) code for 'Character' creation. Don't need to make it nice or specific, I can fix that later.OrHelp on the one i currently have worked on...Thanks in advance,Comments,From: Zananok Link to comment Share on other sites More sharing options...
cheatking Posted December 30, 2008 Share Posted December 30, 2008 http://www.touchofdeathforums.com/smf/index.php?topic=26907.0 Link to comment Share on other sites More sharing options...
Godlord Posted December 30, 2008 Share Posted December 30, 2008 That only has support for account registration though, but some modifications might do for addchar.Regards, Godlord. Link to comment Share on other sites More sharing options...
Zananok Posted December 30, 2008 Author Share Posted December 30, 2008 Here is where I'm stuck (small part of the code):$input = 'acclogin'.$SEP_CHAR.$username.$SEP_CHAR.$password.$SEP_CHAR.$major.$SEP_CHAR.$minor.$SEP_CHAR.'0'.$SEP_CHAR.'270'.$SEP_CHAR.$END_CHAR;$input2 = 'addchar'.$SEP_CHAR.$name.$SEP_CHAR.$gender.$SEP_CHAR.$class.$SEP_CHAR.'1'.$SEP_CHAR.''.$SEP_CHAR.''.$SEP_CHAR.''.$SEP_CHAR.$END_CHAR;$post = socket_write($socket, $input, strlen($input));$post1 = socket_write($socket, $input2, strlen($input2));This should be enough, since it connects and login, then while still login, it creates the char. But it doesn't… tried many different similar ways...Any ideas?Thanks in advance (again),Comments,From: Zananok Link to comment Share on other sites More sharing options...
dg1423 Posted December 30, 2008 Share Posted December 30, 2008 Eh, I'll make one when I get home tonight. Should be easy. Link to comment Share on other sites More sharing options...
Zananok Posted December 30, 2008 Author Share Posted December 30, 2008 Thanks, really appreciated :cheesy:Comments,From: Zananok Link to comment Share on other sites More sharing options...
dg1423 Posted December 31, 2008 Share Posted December 31, 2008 I threw this together last night:http://dg1423.getmyip.com/ttest/test.phpsYou still have to confirm login and it'd be best if you saved account info in a session. Link to comment Share on other sites More sharing options...
Zananok Posted December 31, 2008 Author Share Posted December 31, 2008 @dg1423:> I threw this together last night:> > http://dg1423.getmyip.com/ttest/test.phpsThanks, it helped me.@dg1423:> You still have to confirm login and it'd be best if you saved account info in a session.I'm planning on doing that ;)But, strangely I'm getting the same error as i got before with one of my different tries:```trying to read...Array ( [0] => ALLCHARS [1] => [2] => [3] => [4] => [5] => [6] => [7] => [8] => [9] => [10] => [11] => [12] => [13] => [14] => [15] => [16] => [17] => [18] => [19] => [20] => [21] => [22] => Vagrant [23] => 0 [24] => [25] => [26] => [27] => [28] => [29] => [30] => [31] => [32] => [33] => [34] => [35] => [36] => [37] => [38] => [39] => [40] => [41] => [42] => [43] => [44] => [45] => Vagrant [46] => 0 [47] => [48] => [49] => [50] => [51] => [52] => [53] => [54] => [55] => [56] => [57] => [58] => [59] => [60] => [61] => [62] => [63] => [64] => [65] => [66] => [67] => [68] => Vagrant [69] => 0 [70] => à) trying to read...Array ( [0] => PLAINMSG [1] => Character already exists! [2] => 4à) ```But I already have noticed that when you 'login' and there is no 'char' DAT file on the folder, it auto-creates all 3\. Maybe that's a reason for it happening, maybe it checks if there is a DAT file. Weirdly we know that the code works for the client.. so it should work…Here are my test settings:```$USERNAME = "username";$PASSWORD = "pass";$CHARNAME = "Pizza";$SEX = 1;$CLASS = 0;$CHARNUM = 1;$HEAD = "";$BODY = "";$LEGS = "";```Thanks again and sorry for the trouble.Comments,From: Zananok Link to comment Share on other sites More sharing options...
dg1423 Posted January 2, 2009 Share Posted January 2, 2009 huh, it works perfectly for me. o_O Besides, that message it gave you just means that someone already made a character named Pizza, so try a different character name. Link to comment Share on other sites More sharing options...
Zananok Posted January 2, 2009 Author Share Posted January 2, 2009 Weird.. you use 2.7?Oh and of course I checked if the char already had been created ;)Comments,From: Zananok Link to comment Share on other sites More sharing options...
dg1423 Posted January 2, 2009 Share Posted January 2, 2009 yup, it won't login for any version other than 2.7 (the major, minor, rev and sec numbers only match 2.7) Open up your charlist.txt and make sure, for sure. xD Link to comment Share on other sites More sharing options...
demon xxx x Posted January 2, 2009 Share Posted January 2, 2009 This is strange, it works for me as well. o.o Link to comment Share on other sites More sharing options...
Zananok Posted January 3, 2009 Author Share Posted January 3, 2009 I know that, I went to the source looking for the sec code and the revision :P.Don't worry, I already checkt many times, and the real warning it give us if the name is in use is:```Sorry, but that name is in use!```The code never works for me unless i give a wrong account name or password, but when that happens it creates the chars on the account folder.Here are the full details:I have an account test:```User name = usernamePassword = passChar1 = emptyChar2 = emptyChar3 = empty```Using this settings on the page:```$USERNAME = "username";$PASSWORD = "pass";$CHARNAME = "Pizza";$SEX = 1;$CLASS = 0;$CHARNUM = 1;$HEAD = "";$BODY = "";$LEGS = "";```CharList.txt: Empty (deleted all names [copied to a backup txt :P])Response I get:```trying to read...Array ( [0] => ALLCHARS [1] => [2] => [3] => [4] => [5] => [6] => [7] => [8] => [9] => [10] => [11] => [12] => [13] => [14] => [15] => [16] => [17] => [18] => [19] => [20] => [21] => [22] => Vagrant [23] => 0 [24] => [25] => [26] => [27] => [28] => [29] => [30] => [31] => [32] => [33] => [34] => [35] => [36] => [37] => [38] => [39] => [40] => [41] => [42] => [43] => [44] => [45] => Vagrant [46] => 0 [47] => [48] => [49] => [50] => [51] => [52] => [53] => [54] => [55] => [56] => [57] => [58] => [59] => [60] => [61] => [62] => [63] => [64] => [65] => [66] => [67] => [68] => Vagrant [69] => 0 [70] => à)trying to read...Array ( [0] => PLAINMSG [1] => Character already exists! [2] => 4à) ```Nothing happens on the 'accounts' folder;Reply I get if i change the user name or the password to one that's not compatible with no accounts on my server:```trying to read...Array ( [0] => PLAINMSG [1] => You've entered an incorrect password. [2] => 3à)trying to read...Array ( [0] => ALLCHARS [1] => Pizza [2] => Vagrant [3] => 1 [4] => [5] => Vagrant [6] => 0 [7] => [8] => Vagrant [9] => 0 [10] => à) ```Create 3 char DAT files on the 'accounts' folder and saves the name on the 'CharList.txt' file;Reply I get if i change the user name or the password to one that's not compatible with no accounts on my server, but don't delete the name on the 'CharList.txt':```trying to read...Array ( [0] => PLAINMSG [1] => You've entered an incorrect password. [2] => 3à)trying to read...Array ( [0] => PLAINMSG [1] => Sorry, but that name is in use! [2] => 4à) ```Nothing happens on the 'accounts' folder.Sorry again and thanks for the trouble…Edit: oh and i agree... it's weird...Edit2:Found on the source: If CharExist(Index, CharNum) Then Call PlainMsg(Index, "Character already exists!", 4) Exit Sub End IfFunction CharExist(ByVal Index As Long, ByVal CharNum As Long) As Boolean If Trim$(Player(Index).Char(CharNum).Name) <> vbNullString Then CharExist = True Else CharExist = False End IfEnd FunctionFor me it seems fine...Comments,From: Zananok Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now