PDA

View Full Version : EQemu Login Server


Yeormom
07-14-2009, 04:06 PM
So, whats the story behind the random login server Kimmy? I like the EQEmuAuthCrypto.dll sneak attack! A pleasant surprise.

KLS
07-14-2009, 04:50 PM
I was gonna do it a long time ago but it got quiet and I lost the motivation to do it. Just got around to it, I don't see much harm in it, there's already an unfettered login out anyway.

Yeormom
07-14-2009, 05:04 PM
It is much appreciated because I've been developing against that "unfettered" login server in assembly for the past couple months. You've been on quite the coding spree lately so it seams.

gaeorn
07-14-2009, 05:21 PM
KLS, were you going to create a makefile for linux or are you leaving that for us linux folks to do?

KLS
07-14-2009, 05:39 PM
Pretty much leaving it as it, I haven't actually gone through and compiled anything but the auth part in linux. Which is actually where I'm most concerned about supporting all the distros and setups with a binary.

gaeorn
07-14-2009, 05:42 PM
Ok, then I'll see if I can toss one together. Tho I'll have to find a 32bit system to compile on since all of my servers are 64bit and cross compiling is a pain at best (tho it shouldn't be...).

WildcardX
07-14-2009, 05:43 PM
KLS,

Why did you release our changelog with the project? Did you add anything to the project or is it essentially the same version from our private repository?

KLS
07-14-2009, 05:45 PM
Cause I copied everything in the directory and forgot to take it out?

There are some changes, mostly cleaning up stuff and using the c mysql lib cause I didn't feel like imposing another dependency..

WildcardX
07-14-2009, 06:41 PM
I meant "didn't" not "did" because obviously there is no change log. Thanks for the clarification on what was released.

leslamarch
07-14-2009, 07:09 PM
I was just wondering if anyone else is getting this error.
[error] Load of Security Library 'eqemuAuthCrypto' failed:
Error #126
Security Module Load Failed.
Query failed:I have the crypto in the same directory just cant seem to get past this, any help would be appreciated.

erde
07-16-2009, 03:51 PM
Hi,

i ve tested this with debian x86 and got this error

[Error] Load of Security Library 'libEQEmuAuthCrypto.so' failed:
./libEQEmuAuthCrypto.so: undefined symbol: _ZN8CryptoPP20AllocatorWithCleanupIhLb0EE8allocate EjPKv
Security Module Load Failed.

compiles fine with some small modifications ;) ( Debian x86, OS X 10.5.7 )

I dont expect a fix, this is just to inform you

Yeormom
07-16-2009, 05:27 PM
There may be other libraries you need to have on your server operating system.

KLS
07-16-2009, 05:31 PM
http://www.cryptopp.com/ it's only dependency other than standard stuff, I'll look at making it more standalone. Releasing binaries for linux is annoying =*

nosfentora
07-17-2009, 09:35 AM
looking at the eqemulogin.ini file i filled it out as best i can understand

Port=5998
DumpPacketsIn=true
DumpPacketsOut=true
Trace=true
DatabaseServerName=localhost
DatabaseCatalogName=login
DatabaseUserName=<db login>
DatabaseUserPassword=<db password>
OPCodePathAndFileName=login_opcodes.conf


i'm assuming that
DatabaseServerName= the ip of the mysql db server?
and
DatabaseCatalogName= the database name containing the sql that was provided in login_util?

please correct if i'm wrong.

I copied the compiled binary to login_uitl, created a new database (login), sourced all the sql into that new db. using the above .ini, i'm getting this:


EQEmuLoginServer v1.0 ALPHA by The Oustanding Developers at PEQ!

Using Port: 5998
Dumping Inbound packets.
Dumping Outbound packets.
Tracing ON.
Database Server: localhost
Database Catalog: login


[Error] Load of Security Library 'EQEmuAuthCrypto' failed:
Error #126
Security Module Load Failed.
Server (TCP) listener started.


anyone been successful yet?

erde
07-17-2009, 10:54 AM
Works fine here.

EQEmuAuthCrypto.dll must be in the same place where your exe is.

nosfentora
07-17-2009, 11:10 AM
it is. i made a copy of the login_util folder, and put it in my server folder. copied the compiled EQEmuLoginServer.exe to the login_util folder, edited the .ini file, created the db, sourced the sql's and ran.

even tried modifying my PATH variable to include .\ and ran the login server. still getting error # 126.

leslamarch
07-17-2009, 12:19 PM
nosfentora,
I still have the exact same issue as you, no resolve as of yet. If you compile in debug mode error 126 goes away but still have issues, It would be nice if anyone has this going if they could post some info maybe?

erde
07-17-2009, 01:03 PM
I have the following files in my login directory

EQEmuAuthCrypto.dll
eqemulogin.ini
EQEmuLoginServer.exe
libmysql.dll
login_opcodes.conf

Error 126 means ERROR_MOD_NOT_FOUND

I think you miss a dependency of the dll.

after a bit of googling i found this => http://www.codeguru.com/forum/showthread.php?t=150019

Hope this helps!

nosfentora
07-17-2009, 02:11 PM
I ran dependancy walker on eqemuloginserver.exe
it came up with two missing dll's
wer.dll and
ieshims.dll

i found wer.dll online, and now it's missing nvcrypt.dll

i found nvcrypt.dll and now it's missing bcrypt.dll.....

erde
07-17-2009, 02:59 PM
I dont know whats wrong! I've test the login server with Windows XP Prof and Windows Server 2003 Enterprise. Works without any errors!

Sorry, i am out of ideas.

nosfentora
07-17-2009, 03:10 PM
me too! just out of curiosity, would you mind doing a filesearch for ncrypt.dll, bcrypt.dll and wer.dll on your machine? (or any one of the three)

KLS
07-17-2009, 03:26 PM
Are you using windows7?

nosfentora
07-17-2009, 03:32 PM
Nope, xp pro 32 sp3, and server 2003 sp2

KLS
07-17-2009, 03:39 PM
Hm http://projecteqemu.googlecode.com/files/EQEmuLoginServer.zip is the binary version I built the other day.

nosfentora
07-17-2009, 03:45 PM
Hmm... now that one worked, but the one i built was giving the errors i posted earlier.

it compiled fine, with no errors but about ~290 warnings.

KLS
07-17-2009, 03:46 PM
Probably something to do with compile time options or the compiler then.

nosfentora
07-17-2009, 03:47 PM
I don't know if this makes a difference, but i added the loginserver project to the main server project and built that way. i didn't even think of that till now. i'll try to open and compile it separately and see what happens.

nosfentora
07-17-2009, 03:53 PM
The one you provided is 1.38mb, the one i just compiled (separate of the eqemuserver) is 360k
Visual Studio 2008

cavedude
07-17-2009, 04:03 PM
EQEmuLoginServer v1.0 ALPHA by The Oustanding Developers at PEQ!

HAHAHA that's awesome. I hope others get the joke :)

leslamarch
07-17-2009, 04:04 PM
The one you provided is 1.38mb, the one i just compiled (separate of the eqemuserver) is 360k
Visual Studio 2008
exact same as mine, now that the error went away with KLS exe, I tried to login and I get blank server select. :( Nos is it working for you?

KLS
07-17-2009, 04:12 PM
The one I compiled is probably debug mode.

nosfentora
07-17-2009, 04:19 PM
I re-compiled debug and got a file 1.39mb, and it worked just like yours.

@leslamarch
haven't tried it yet. will post back in a min

KLS
07-17-2009, 04:20 PM
I added release dll to svn.

nosfentora
07-17-2009, 04:32 PM
Ok, using the 'debug' version, i changed my eqemuconfig.xml to read

<loginserver>
<host>localhost</host>
<port>5998</port>
<account></account>
<password></password>
</loginserver>


forwarded port 5998 on my router to the correct internal ip.

fired up my eq server and apparently it connected

[Debug] [WORLD__LS] Connecting to login server...
[Debug] [WORLD__LS] Connected to Loginserver: localhost:5998
[Debug] [WORLD__ZONE] New TCP connection from 127.0.0.1:3813
[Debug] [WORLD__CONSOLE] New launcher from 127.0.0.1:3813


might need to change localhost to my external ip, not sure yet.

can't log in to server select as i believe the tables in the database are all empty and don't contain any valid info yet.

seems like a step in the right direction at least!

leslamarch
07-17-2009, 04:34 PM
also this login server uses sha encryption and not md5 so when you make your account do it that way.

nosfentora
07-17-2009, 04:40 PM
Beh, don't know where it went, but i had just posted asking about how to add a ls to the db.

i'm assuming that everything is done by hand through sql?

what's the formula for the pass? straight sha1(pass) or sha1(loginpass), etc?

nosfentora
07-17-2009, 04:42 PM
Re-compiled release, and used the release .dll, and back to the same error #126

the debug .exe seems to work with either .dll

leslamarch
07-17-2009, 11:21 PM
Beh, don't know where it went, but i had just posted asking about how to add a ls to the db.

i'm assuming that everything is done by hand through sql?

what's the formula for the pass? straight sha1(pass) or sha1(loginpass), etc?
KLS had this in one of the SQL dont remember what one now but here it is
insert into tblLoginServerAccounts (AccountName, AccountPassword, AccountEmail, LastLoginDate, LastIPAddress) values('Admin', sha('password'), 'admin@somewhere.com', now(), '127.0.0.1');after the last commit KLS made everything is working fine here, it compiles and works. I'm still having 1 issue if someone could shed some light on this I would really appreciate it. If I connect my server to the login anonymously I can log in and play, but when I fill in this "tblserveradminregistration" to match my eqemu_config.xml to get legend status it will not alllow my server to connect.

KLS
07-18-2009, 02:24 AM
The project was set to unicode in release instead of multibyte which was causing issues with the const char* to LPRSTR conversion.

AccountPassword for server reg isn't hashed in the DB, also need to make sure there's a tblworldserverregistration entry that matches up with the tblserveradminregistration entry.

nosfentora
07-18-2009, 12:19 PM
KLS had this in one of the SQL dont remember what one now but here it is
insert into tblLoginServerAccounts (AccountName, AccountPassword, AccountEmail, LastLoginDate, LastIPAddress) values('Admin', sha('password'), 'admin@somewhere.com', now(), '127.0.0.1');after the last commit KLS made everything is working fine here, it compiles and works. I'm still having 1 issue if someone could shed some light on this I would really appreciate it. If I connect my server to the login anonymously I can log in and play, but when I fill in this "tblserveradminregistration" to match my eqemu_config.xml to get legend status it will not alllow my server to connect.

duh, if i actually opened the sql instead of just sourcing them, i'd have seen that! =) (EQEmuLoginServerDBInstall.sql)

thanks leslamarch!

nosfentora
07-20-2009, 03:46 PM
Ok, unless i'm completely stupid and missed something critical... here's what i've done so far:

1 ) Pulled sources rev 800.
2 ) compiled 'release'
3 ) copied the new 'EQEmuLoginServer.exe' and release 'EQEmuAuthCrypto.dll' to a separate folder containing 'libmysql.dll','login_opcodes.conf,' and 'eqemulogin.ini'.

4 ) started 'EQEmuLoginServer.exe' and it seems to be ok:


EQEmuLoginServer

Using Port: 5998
Dumping Inbound packets.
Dumping Outbound packets.
Tracing ON.
Database Server: localhost
Database Catalog: login


Server (TCP) listener started.


5 ) created a new database 'login', and sourced 'EQEmuLoginServerDBInstall.sql'

6 ) in 'tblloginserveraccounts' i created an account entry using


insert into tblLoginServerAccounts
(AccountName, AccountPassword, AccountEmail, LastLoginDate, LastIPAddress)
values ('nosfentora', sha('obviouslynotmypassword'), 'myemail@yahoo.com', now(), '192.168.1.105');


7 ) in 'tblserveradminregistration' i added an entry

insert into tblserveradminregistration (Accountname,AccountPassword,FirstName,LastName,Em ail,RegistrationDate,RegistrationIPAddr)
values ('nosfentora','obviouslynotmypassword','MyName','M yLastName','MyEMail@yahoo.com',now(),'192.168.1.10 5');


8 ) in 'tblworldserverregistration' i added an entry

insert into tblworldserverregistration
(ServerID,ServerLongName,ServerTagDescription,Serv erShortName,ServerListTypeID,ServerLastLoginDate,S erverLastIPAddr,ServerAdminID,Note)
values
('1','LongNameFromConfig','Blah','ShortNameFromCon fig','3',now(),'192.168.1.105','1','');


where the ServerAdminID=1, from 'tblserveradminregistration', ServerAdminID

9 ) In my eqemu db, in 'account' i added an entry
with the lsaccount_id=1, and status=250
where lsaccount_id=1=LoginServerID from 'tblloginserveraccounts'

10 ) I modified my 'eqemu_config.xml' to read


<loginserver>
<host>localhost</host>
<port>5998</port>
<account></account>
<password></password>
</loginserver>


11 ) fired up world and


[Debug] [WORLD__LS] Connecting to login server...
[Debug] [WORLD__LS] Connected to Loginserver: localhost:5998


the login server spits out a bunch of text about 'Updating stats for server'


Received server Opcode: 1001, Size: 12
0: FE FF FF FF 00 00 00 00 - 00 00 00 00 | ............
ServerOP_LSStatus: Status: -2 Players: 0 Zones: 0


so far, i think, so good.....

12 ) edit and save my eqhost.txt:


[LoginServer]
Host=192.168.1.103:5998


13 ) fire up SoF client..., login using user/pass created in step 6 and see my server in the list!

Yea! :D or so i thought....

I select my server and click Play....

:) ...... :confused: ....... :mad:

This error pops up


'Error 1017: Cannot login to the EverQuest server.
You may need to re-run the Update Patch.
Repeatedly seeing this message indicates a loss of connectivity
to the Patch Server. This is usually temporary'


and then an empty server list.



Any ideas?

leslamarch
07-20-2009, 06:07 PM
well the login server is working fine for you now :). Sounds like there may be a conflict in the eqemu account table? have you tried this with a clean DB install ?

nosfentora
07-21-2009, 09:15 AM
"clean" as in i had installed fresh (rev781, on 7/17), but re-sourced my characters back in (i think the account table was part of the characters backup i did).

i did change my account table to use the local login LoginServerID, instead of the one created through eqemulator... i'll try fresh again, without sourcing my characters and see what happens.

nosfentora
07-21-2009, 10:00 AM
Ok, fired up everything (using the debug ver of login server) and shortly after clicking 'login' the following error popped up:


Microsoft Visual C++ Debug Library
Debug Error!

Program: C:\Servers\EQ\Server\login_util\EQEmuLoginServer.e xe

HEAP CORRUPTION DETECTED: after Normal block (#918) at 0x003BD658.
CRT detected that the application wrote to memory after end of heap buffer.

Abort / Retry / Ignore



just for s.a.g. i clicked 'ignore' and was logged in to char select.

created a char, and logged in ok.

/q'd out and got the same error again - was brought back to the server select screen with an empty server list.

rebuilt the login server 'release' and fired up everything again.... it seems i was 'hasty' in trying to log in and needed to give the server a minute or two to settle down/initialize everything as i can login now.

yea!!!

nosfentora
07-21-2009, 11:50 AM
Beh - back to error 1017 if i run the login server, world, zone, chat and mail servers on a separate computer, on the same lan and try and connect via lan ip's only, as well as external ip's w/ port forwarding.

btw - i have all the ports forwarded for both tcp and udp data, should some only be tcp and other udp?

pfyon
07-27-2009, 02:34 PM
Anyone with a bit more experience using make and g++ able to create a makefile for this?

gaeorn
07-27-2009, 09:27 PM
Anyone with a bit more experience using make and g++ able to create a makefile for this?

I just added a makefile to svn. Also patched files to allow compiling under linux and converted the utf16 SQL files to ascii text.

pfyon
07-28-2009, 03:39 PM
Excellent, thanks gaeorn.

norsan
07-31-2009, 10:49 PM
ok well i go this up and running but it seems it times out and removes all world servers from the list after being idle for 15-30 minutes any idea why?

norsan
08-01-2009, 04:12 AM
also it should be noted the only client ive gottn to connect to the ls is SoF titanium doesnt seem to work

Sylaei
08-02-2009, 02:55 PM
I am unable to login using the eqemuloginserver. I have followed these instructions: http://www.eqemulator.net/wiki/wikka.php?wakka=ValesEQ and http://www.eqemulator.net/forums/showpost.php?p=174840&postcount=41 from nosfentora. I can't find any error messages in any log files about the no user account or incorrect password. Obviously the error message itself is from Everquest and not the emulator.

Created a server with 774 and revision 859 on the db. Also I have tried logging in with both Titanium and SOF.

Thanks

Sylaei
08-03-2009, 11:02 PM
Ok, I'm going to admit that I don't know much about encryption but the only way I was able to login was to set my password as '11111111'. I had to use 8, 7 wouldn't work for me. A password with 8 chars wouldn't work, and a password with 8 2's would not work.

I assume that it must be some kind of fluke that this worked for me, but I wanted to mention it in case there was some error with the encryption.

Just a guess on my part.

norsan
08-04-2009, 02:03 AM
i have issues with it removing disconnected worldservers at present and cant run run the linux compile on fc 6 have to use wine because libeqmuauthcrypto throws errors. i too noticed the password error

norsan
08-04-2009, 02:08 AM
[Error] Load of Security Library 'libEQEmuAuthCrypto.so' failed:
./libEQEmuAuthCrypto.so: undefined symbol: _ZN8CryptoPP20AllocatorWithCleanupIhLb0EE8allocate EjPKv
Security Module Load Failed.

thatss the error im getting wihthe linux compile any ideas?

tnance1337
08-04-2009, 11:40 AM
Ok, I'm going to admit that I don't know much about encryption but the only way I was able to login was to set my password as '11111111'. I had to use 8, 7 wouldn't work for me. A password with 8 chars wouldn't work, and a password with 8 2's would not work.

I assume that it must be some kind of fluke that this worked for me, but I wanted to mention it in case there was some error with the encryption.

Just a guess on my part.

Wow, I must say I didn't toy with any password under 8 characters before, but first password I created for 6 characters (4 numbers and 2 letters) worked. Not sure why 8 characters (all letters) didn't work before, but I don't really care so long as it works now. Thanks for the idea.

nosfentora
08-05-2009, 10:29 AM
Ok, I'm going to admit that I don't know much about encryption but the only way I was able to login was to set my password as '11111111'. I had to use 8, 7 wouldn't work for me. A password with 8 chars wouldn't work, and a password with 8 2's would not work.

I assume that it must be some kind of fluke that this worked for me, but I wanted to mention it in case there was some error with the encryption.

Just a guess on my part.

Do you mean you put the pw in plain-text as '11111111'? If so, you need to run a query

update tblLoginServerAccounts set AccountPassword=sha('<your password') where AccountName='<your account name>'

nosfentora
08-05-2009, 10:32 AM
[Error] Load of Security Library 'libEQEmuAuthCrypto.so' failed:
./libEQEmuAuthCrypto.so: undefined symbol: _ZN8CryptoPP20AllocatorWithCleanupIhLb0EE8allocate EjPKv
Security Module Load Failed.

thatss the error im getting wihthe linux compile any ideas?

Did you use the pre-compiled binary or compile your own? If you compiled your own, make sure you used the corresponding EQEmuAuthCrypto.dll. Ie if you compiled RELEASE, then you need to use the EQEmuAuthCrypto.dll from EQEmuLoginServer\login_util\ms\release

Edit: I just re-read your post and saw you were using linux - i don't know if the .so file is for both release/debug vers or not.

nosfentora
08-05-2009, 10:35 AM
I am unable to login using the eqemuloginserver. I have followed these instructions: http://www.eqemulator.net/wiki/wikka.php?wakka=ValesEQ and http://www.eqemulator.net/forums/showpost.php?p=174840&postcount=41 from nosfentora. I can't find any error messages in any log files about the no user account or incorrect password. Obviously the error message itself is from Everquest and not the emulator.

Created a server with 774 and revision 859 on the db. Also I have tried logging in with both Titanium and SOF.

Thanks

I was able to log in if all ip's involved were internal ip's (ie 192.168.xxx.xxx) or localhost. I wasn't able to login using any external ip's, even with all the ports forwarded to the corresponding internal ip's.

haven't had much time to play with it of late.

norsan
08-05-2009, 11:10 AM
i compild my own undr windows and also undr linux he linux cypto library throws an error under linux i run the windows compile under wine atm because of this

Sylaei
08-05-2009, 08:51 PM
I was able to log in if all ip's involved were internal ip's (ie 192.168.xxx.xxx) or localhost. I wasn't able to login using any external ip's, even with all the ports forwarded to the corresponding internal ip's.

haven't had much time to play with it of late.

Nos, I have had trouble in the past getting people to be able to log in from external addresses. I had to setup the eqemu_config.xml file with the dns name. I got the dns name from dyndns, so the dns name pointed to my ip on my router. I then had to modify the hosts file on each pc on the internal network with the internal address associated with the dns name. That was the only way I was able to get both internal and external addresses to work.

Sylaei
08-05-2009, 08:58 PM
Continued from above (couldn't edit) :-)

My issue stems from the everquest client not passing the correct username or password to my login database. I did use the query to enter the password so that the password is sha encrypted.

Since I have gotten an account to work I am assuming that the eq client is not handling the password/encryption in the same way that the we are adding it to the database. There may be something else I am forgetting or not realized I should have done.

KLS
08-06-2009, 01:27 AM
Not entirely pertaining to what's being discussed now but: going to be changing how the securitylib works eventually for linux since the .so has been fairly problematic.

nosfentora
08-06-2009, 09:08 AM
Nos, I have had trouble in the past getting people to be able to log in from external addresses. I had to setup the eqemu_config.xml file with the dns name. I got the dns name from dyndns, so the dns name pointed to my ip on my router. I then had to modify the hosts file on each pc on the internal network with the internal address associated with the dns name. That was the only way I was able to get both internal and external addresses to work.

I never had a problem setting up a server using external ip's if using eqemulator.net to log in - only the newly-released login server. using eqemulator.net, i could log in locally or remotely w/o a problem.

like i said, i haven't had much time to play with it, but i'll try the dns approach as soon as i can.

Thanks!

Sylaei
08-08-2009, 06:06 PM
Nos, Sorry I should have mentioned that at the time I was using minilogin and not the public server.

I have migrated to the eqemuloginserver but still hosted internally.

nosfentora
08-13-2009, 03:50 PM
has anyone been able to get this to work with remote connections?

norsan
08-13-2009, 05:26 PM
yeah i have it does not accept world server connections not defined in th worldregistration table it allows them to connect but cant process logins to it due to it not setting the serverid properly

nosfentora
08-13-2009, 05:53 PM
i have that table filled out, same info i put in my config.xml.

would you mind posting what you did to get it to work, maybe i missed something.

norsan
08-13-2009, 06:25 PM
i did nothing else besides the normal configuration and setup of the emulator server as outlined in the wiki guides nothing special or different just a normal outa box setup

norsan
08-13-2009, 06:26 PM
as a side question any word when the new security library for linux will be done kls?

nosfentora
08-13-2009, 06:40 PM
are you talking about the mini login or the new EQEmuLoginServer?

norsan
08-14-2009, 01:48 AM
dude this ls i have never and will never use minilogin seriously all i did was setup a normal worldserver and that was that put it in the ls database made my ls account and that was it there is no special trick i used that im not sharing lol seriously just follow the guides check for typos and make sure you got the ip stuff setup right in the config file thats all i did

nosfentora
08-14-2009, 07:43 AM
dude chill! miscommunication happens! just making sure we're on the same page.
the only reason i asked is you said 'guides' and i don't see a guide anywhere for the new ls.
thanks for the clarification.

nosfentora
08-14-2009, 07:49 AM
Check that 'don't see a guide', i'm a 'tard and don't read everything thoroughly.

norsan
08-14-2009, 08:49 AM
i meant for the worldserver i set it up exactly like i would connecting to anything but minilogin eg the official ls if you put all the right info in the db and follow this thread it will work perfectly if not then its a porting issue with eithr a firewall router or your isp as a whole i have no idea what to tell you but all i did was follow the normal emu setup guide and the ls was a breeze to setup without any guide took me all of 10 minutes start to finish. lemme break it down

1 source the ls sql files
2 make sure the ini opcode and appropriate eqemuauthcrypto.dll files are in the same folder as the exe
3 make a world entry for your worldserver in the tblworldserverregistration table
3 make serveradmin entry for same worldserver( Eg the username and password you put into the loginservr block of the eqemu_config.xml file for the emulator)
4 make account in loginserveraccounts table following the insert for example contained in tis thread and the sql file for the ls itself use a pass of 6 characters

fire it all up as normal and if your porting and ip settins are correct for the worldserver whala bobs your uncle

nosfentora
08-14-2009, 10:15 AM
logging into my server remotely via the public login works fine, so my ports should be good to go.

i setup the login server prior to the guide (which is why i didn't see the 'guide' post.). i set up everything again, exactly according to the guide, (but used no-ip.org instead of dyndns). i can log in, get to server select, see my server and bam - error 1017.

somewhere along the line the login server is not communicating with the emu. that's my hangup.

nosfentora
08-14-2009, 10:22 AM
FYI the ports I have forwarded are
5996-6000,6999-7101,8999-9101,7776-8000 TCP and UDP

norsan
08-14-2009, 10:28 AM
actually it is if remotely works then all communication is fine then you need to do the natfix in the wiki

nosfentora
08-14-2009, 12:00 PM
yep - still 1017...

/stumped

norsan
08-14-2009, 12:59 PM
i have no idea what to tell you it works perfectly for me sorry lol

nosfentora
08-15-2009, 09:29 AM
No worries - thanks for the try!

norsan
08-17-2009, 08:12 PM
i ws looking through the source to this, and notice alot of todos is this not complete if so is it going to be actively developed?

WildcardX
08-18-2009, 12:40 AM
There was a time when the LS source code rewrite was a priority but after our existing public LS was stabilized, I put the LS code you see now on the back burner and focused on other things I had going on at the time. This code wasn't really ready for use when KLS made it available to the community so there are a lot of known issues you are all going to have to work through to get the quality you are hoping for or expecting.

KLS
08-18-2009, 03:58 AM
Yeah I mean I provided it 'as is' incase anyone wanted to work on it or wanted an alternative to minilogin if they could get it to work. It's certainly not production ready but it works well enough in my opinion.

Figured it would be of better use than sitting on my hard drive collecting virtual dust.

norsan
08-18-2009, 06:02 AM
ok but its cool if someone picks it up and starts activly developing it right?

its got a few bugs aka issues that ive seen but nothing that cant be worked through if a few people work on it just gotta find the few people to do it lol.

for instance ive been tinkering with the bit that shows up down or the number of players thus far no luck but atleat now i know what doesnt work lol

nosfentora
08-19-2009, 11:23 AM
Gotcha - tbh i hadn't even looked at the source for it. Who knows - maybe i'll take a whack at it if i ever have time.

Thanks!

pfyon
08-20-2009, 11:01 AM
Having issues connecting to my loginserver from my main computer. LS is running on ubuntu server 8.04, and compiled myself.


EQEmuLoginServer

Using Port: 5998
Dumping Inbound packets.
Dumping Outbound packets.
Tracing ON.
Database Server: localhost
Database Catalog: loginserver


[Error] Load of Security Library 'libEQEmuAuthCrypto.so' failed:
libEQEmuAuthCrypto.so: cannot open shared object file: No such file or directory
Security Module Load Failed.
Failed to open log file: logs/eqemu_debug_28142.log
[Debug] [COMMON__THREADS] Starting EQStreamFactoryReaderLoop with thread ID -1214366832
[Debug] [COMMON__THREADS] Starting EQStreamFactoryWriterLoop with thread ID -1222759536
[Debug] [WORLD__LS] Client (UDP) listener started.
[Debug] [COMMON__THREADS] Starting TCPServerLoop with thread ID -1231217776
Server (TCP) listener started.
New Client UDP connection from 192.168.1.101:2688
0: 02 00 00 00 00 00 00 00 - 00 00 0B 00 | ............
Client OPCode: 184 Received
OP_Session_Ready
0: 02 00 00 00 00 00 00 00 - 00 01 65 00 00 00 00 43 | ..........e....C
16: 68 61 74 4D 65 73 73 61 - 67 65 00 | hatMessage.
0: 03 00 00 00 00 02 00 00 - 00 00 18 2D 2B 39 F4 7E | ...........-+9.~
16: 5D 96 5D 73 2B 87 38 9C - EE 17 | ].]s+.8...
Client OPCode: 185 Received
OP_Login
0: 03 00 00 00 00 02 00 00 - 00 00 18 2D 2B 39 F4 7E | ...........-+9.~
16: 5D 96 5D 73 2B 87 38 9C - EE 17 | ].]s+.8...
Segmentation fault


The libEQEmuAuthCrypto.so file exists and has a symlink in the main directory to login_util/. Has anyone gotten this working reliably on linux?

bergalas
08-20-2009, 06:57 PM
i use wine

gaeorn
08-21-2009, 04:56 PM
Having issues connecting to my loginserver from my main computer. LS is running on ubuntu server 8.04, and compiled myself.


EQEmuLoginServer

Using Port: 5998
Dumping Inbound packets.
Dumping Outbound packets.
Tracing ON.
Database Server: localhost
Database Catalog: loginserver


[Error] Load of Security Library 'libEQEmuAuthCrypto.so' failed:
libEQEmuAuthCrypto.so: cannot open shared object file: No such file or directory
Security Module Load Failed.
Failed to open log file: logs/eqemu_debug_28142.log
[Debug] [COMMON__THREADS] Starting EQStreamFactoryReaderLoop with thread ID -1214366832
[Debug] [COMMON__THREADS] Starting EQStreamFactoryWriterLoop with thread ID -1222759536
[Debug] [WORLD__LS] Client (UDP) listener started.
[Debug] [COMMON__THREADS] Starting TCPServerLoop with thread ID -1231217776
Server (TCP) listener started.
New Client UDP connection from 192.168.1.101:2688
0: 02 00 00 00 00 00 00 00 - 00 00 0B 00 | ............
Client OPCode: 184 Received
OP_Session_Ready
0: 02 00 00 00 00 00 00 00 - 00 01 65 00 00 00 00 43 | ..........e....C
16: 68 61 74 4D 65 73 73 61 - 67 65 00 | hatMessage.
0: 03 00 00 00 00 02 00 00 - 00 00 18 2D 2B 39 F4 7E | ...........-+9.~
16: 5D 96 5D 73 2B 87 38 9C - EE 17 | ].]s+.8...
Client OPCode: 185 Received
OP_Login
0: 03 00 00 00 00 02 00 00 - 00 00 18 2D 2B 39 F4 7E | ...........-+9.~
16: 5D 96 5D 73 2B 87 38 9C - EE 17 | ].]s+.8...
Segmentation fault


The libEQEmuAuthCrypto.so file exists and has a symlink in the main directory to login_util/. Has anyone gotten this working reliably on linux?

You need to set LD_LIBRARY_PATH to include the directory the libEQEmuAuthCrypto.so is in. Look at the startup scripts for the world server to see how to do this.

pfyon
08-22-2009, 12:08 AM
Hi,

i ve tested this with debian x86 and got this error

[Error] Load of Security Library 'libEQEmuAuthCrypto.so' failed:
./libEQEmuAuthCrypto.so: undefined symbol: _ZN8CryptoPP20AllocatorWithCleanupIhLb0EE8allocate EjPKv
Security Module Load Failed.

compiles fine with some small modifications ;) ( Debian x86, OS X 10.5.7 )

I dont expect a fix, this is just to inform you

Getting this error as well, what was the fix?

edit: Also, thanks gaeorn for the LD_LIBRARY_PATH help, got a startup script that gets as far as the above error now.

bergalas
08-22-2009, 12:23 PM
earlier in this thread, kls said she was reworking the lib file so that it would work beter for linux users thus far no fix i can see i just use wine.

jimm0thy
09-05-2009, 12:55 AM
While everything is technically working for me , anytime someone connects to the server I get a debugging error from EQEmuLoginServer.exe , however hitting ignore will allow me to connect.

jimm0thy
09-05-2009, 03:15 AM
Well solved my problem with a combination of compiling the exe to release instead of debug and using realse dll at same time.

Magnus369
12-31-2009, 04:17 PM
I'm getting the same error in regards to the crypto lib not loading:
-----------------------------
chatserver EQEmuLoginServer libcryptopp.la libEMuShareMem.so ms plugins tblServerListType.sql
cleanipc EQEmuLoginServerDBInstall.sql libcryptopp.so libEQEmuAuthCrypto.so patch_6.2.conf quests tblWorldServerRegistration.sql
commands.pl eqlaunch libcryptopp.so.7 log.ini patch_Anniversary.conf spells_en.txt templates
crashlog eqtime.cfg libcrypto++.so login_opcodes.conf patch_Live.conf spells_us.txt world
database libcrypt.a libcrypto.so.0.9.8 logs patch_SoF.conf start worldui
eqemu_config.xml libcrypto++.a libcrypto++.so.7 mailserver patch_Titanium.conf stop worldui.pl
eqemu_config.xml.full libcrypto++.la libcrypto++.so.7.0.0 Maps persist_world tblLoginServerAccounts.sql zone
eqemulogin.ini libcryptopp.a libcrypt.so mime.types plugin.pl tblServerAdminRegistration.sql
eqemu@linuxeq:~/server$ nm libcrypt* | grep _ZN8CryptoPP20AllocatorWithCleanupIhLb0EE8allocate EjPKv
00000000 W _ZN8CryptoPP20AllocatorWithCleanupIhLb0EE8allocate EjPKv
U _ZN8CryptoPP20AllocatorWithCleanupIhLb0EE8allocate EjPKv
U _ZN8CryptoPP20AllocatorWithCleanupIhLb0EE8allocate EjPKv
nm: libcrypto++.la: File format not recognized
00000000 W _ZN8CryptoPP20AllocatorWithCleanupIhLb0EE8allocate EjPKv
U _ZN8CryptoPP20AllocatorWithCleanupIhLb0EE8allocate EjPKv
U _ZN8CryptoPP20AllocatorWithCleanupIhLb0EE8allocate EjPKv
nm: libcryptopp.la: File format not recognized
nm: libcryptopp.so: no symbols
nm: libcryptopp.so.7: no symbols
nm: libcrypto++.so: no symbols
nm: libcrypto.so.0.9.8: no symbols
nm: libcrypto++.so.7: no symbols
nm: libcrypto++.so.7.0.0: no symbols
nm: libcrypt.so: no symbols
eqemu@linuxeq:~/server$ ./EQEmuLoginServer
EQEmuLoginServer

Using Port: 5998
Dumping Inbound packets.
Dumping Outbound packets.
Tracing ON.
Database Server: 192.168.1.23
Database Catalog: peq


[Error] Load of Security Library 'libEQEmuAuthCrypto.so' failed:
libEQEmuAuthCrypto.so: undefined symbol: _ZN8CryptoPP20AllocatorWithCleanupIhLb0EE8allocate EjPKv
Security Module Load Failed.
[Debug] Starting Log: logs/eqemu_debug_18551.log


----------------------

So, I went a little nuts and copied the libraries to the same directory the executable gets run from, the ld path is exported... but the library is still refusing to load due to error. is there anyway to get the source code for libEQEmuAuthCrypto.so, in order to continue trying to fix this headache? as far as I can tell, the rest is working, I can get to a client login before the program segfaults (go figure- no libEQEmuAuthCrypto loaded, no functions actually available for , boom), and of course it faults at line 157 in clientlist.cpp
char *CryptoBuffer = EQCrypto.DecryptUsernamePassword((const char*)app->pBuffer, app->Size(), 5);

any help would be greatly appreciated, and as always, thanks for the work on this project so far!

cavedude
12-31-2009, 05:37 PM
Sadly, the encryption and Linux don't mix. ATM, the only way to get it to work under Linux consistently is to use WINE. There is no native solution that works on every distro currently. :(

Magnus369
12-31-2009, 06:12 PM
Well, then here's a dumb question-

After login, what's responsible for maintaining the connection? ie, is there any reason I'd actually have to run the login server on a linux box if it's actually a low bandwidth/connection count service? if it's not responsible for anything more than just login brokering, then I don't see a reason to keep it on the same box.

Also- that error I posted occurs on ubuntu 8.10 server as well as fedora core 11, and I'm not entirely sure what the others were running, but no go eh?

What about the question of getting the source? I'd be more than happy to try to get it working.

pfyon
01-29-2010, 06:44 PM
So one of the somewhat recent changes is the inclusion of EQCryptoAPI.h in clientlist.cpp, however, it isn't included in the source. Is it still under development and not ready for release, or is there some other reason it isn't there?

KLS
01-29-2010, 08:27 PM
#ifndef EQEMUCAPI__H
#define EQEMUCAPI__H

char* DecryptUsernamePassword(const char* encryptedBuffer, unsigned int bufferSize, int mode);
char* Encrypt(const char* buffer, unsigned int bufferSize, unsigned int &outSize);
void _HeapDeleteCharBuffer(char *buffer);

#endif

pfyon
01-30-2010, 12:53 AM
Awesome, thanks KLS, compiles fine now.

cubber
04-04-2010, 01:08 PM
Here is an Account Creation web front end tool I wrote for the SVN Loginserver. It can be added to a server webpage to allow users to create accounts, it then emails the server admin the new account information.

It consists of 2 files eqreg.php and insert.php

Note: Make sure to change the mysql server info and email address in insert.php before using.

eqreg.php

<!-- EQEMu SVN Loginserver PHP Account Registration Page - By: Cubber -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict/EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>EQEmu SVN Loginserver Account Registration Page</title>

<meta name="description" content="EQEmulator SVN Loginserver Account Registration Page.">

</head>

<body>

<h1>EQ Registration Form</h1>
<p>Please fill out the form below to create a new account.</p>
<br />

<form method="post" action="insert.php">
Username: <i>(Max 16 chars)</i><br />
<input name="username" type="text" id="username" maxlength="16" />
<br /><br />
Password: <i>(Max 16 chars)</i><br />
<input name="pw" type="password" id="pw" maxlength="16" />
<br /><br />
Email:<br />
<input name="email" type="text" id="email" maxlength="50" />
<br /><br />
<br />
<input name="Submit" type="submit" value="Create Account" />
</form>
<br />


</body>
</html>


insert.php


<!-- EQEMu SVN Loginserver PHP Account Registration Page - By: Cubber -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict/EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>>EQEmu SVN Loginserver Account Registration Page</title>

<meta name="description" content="EQEmulator SVN Loginserver Account Registration Page.">

<head>

<body>

<p>
<?php

$DB_ADDY = "localhost"; //address:port for the MySQL server
$DB_USER = "eqemu"; //username to login to MySQL with
$DB_PASS = "eqemu"; //password to login to MySQL with
$DB_DB = "peq"; //database name to use "peq" for default installation
$user = $_POST['username'];
$pass = $_POST['pw'];
$acct_email = $_POST['email'];
$sendto = "youremail@something.com";
$subject = "New EQEmu Account Created";
$message = "A new account has been created on the EQEmu Server. Account details: - email: $acct_email\n - username: $user\n - password: $pass\n";


function error_s($text) {
echo("<p>" . $text);
};

$user_chars = "#[^a-zA-Z0-9_\-]#";
$email_chars = "/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/";

if ( !isset($_POST['username']) || !isset($_POST['pw']) || !isset($_POST['email']) )
{
echo "User/Pass/Email not passed.";
return;
}

$con = @mysql_connect($DB_ADDY, $DB_USER, $DB_PASS);
if (!$con) {
error_s("Unable to connect to database: " . mysql_error());
};

if (!empty($_POST)) {
if ((empty($_POST["username"]))||(empty($_POST["pw"]))||(empty($_POST["email"])) ) {
error_s("You did not enter all the required information.");
exit();
} else {

$username = ($_POST["username"]);
$pw = ($_POST["pw"]);
$email = ($_POST["email"]);
if (strlen($username) < 5) {
error_s("Username too short.");
exit();
};
if (strlen($username) > 16) {
error_s("Username too long.");
exit();
};
if (strlen($pw) < 6) {
error_s("Password too short.");
exit();
};
if (strlen($pw) > 16) {
error_s("Password too long.");
exit();
};
if (strlen($email) < 10) {
error_s("Email was too short.");
exit();
};
if (strlen($email) > 50) {
error_s("Email was too long.");
exit();
};
if (preg_match($user_chars,$username)) {
error_s("Username contained illegal characters.");
exit();
};
if (preg_match($user_chars,$pw)) {
error_s("Password contained illegal characters.");
exit();
};
if (!preg_match($email_chars,$email)) {
error_s("Email was in an incorrect format.");
exit();
};

$username = mysql_real_escape_string($username);
$pw = mysql_real_escape_string($pw);
$email = mysql_real_escape_string($email);
$qry = @mysql_query("select AccountName from " . mysql_real_escape_string($DB_DB) . ".tblLoginServerAccounts where AccountName = '" . $username . "'", $con);
if (!$qry) {
error_s("Error querying database: " . mysql_error());
};
if ($existing_username = mysql_fetch_assoc($qry)) {
foreach ($existing_username as $key => $value) {
$existing_username = $value;
};
};
$existing_username = ($existing_username);
if ($existing_username == ($_POST['username'])) {
error_s("That username is already taken. Click <a href=eqreg.php>here</a> and try again.");
exit();
};
unset($qry);

$sha_pass_hash = sha1(($pw));
$register_sql = "insert into " . mysql_real_escape_string($DB_DB) . ".tblLoginServerAccounts (AccountName,AccountPassword,AccountEmail) values ('" . $username . "','" . $sha_pass_hash . "','" . $email . "')";
$qry = @mysql_query($register_sql, $con);
if (!$qry) {
error_s("Error creating account: " . mysql_error());
};
mail($sendto, $subject, $message);
echo("Your account was successfully created!");
exit();
};
} else {
echo($page);
};

?>
</p>


</body>
</html>





I also added captcha to the version I use on my website, I use an opensource captcha called securimage, you can find it here http://www.phpcaptcha.org/

It works rather well and is easily incorporated into the page. I did not put it into the posted code because I figured I would leave it very simple so that folks could customize it as they see fit.

Enjoy!

trevius
04-04-2010, 11:23 PM
Wow, thanks for sharing that, I might have to give it a try! It probably wouldn't hurt to have something like that on the SVN for people to use and update as needed :) Would have to see what the other devs think of putting something like that on the SVN though.

cubber
04-05-2010, 09:28 AM
Your welcome :cool:

I don't mind at all if it gets added to SVN

cubber
04-06-2010, 05:14 PM
Version 1.1

Fixes:

- Added password confirmation box to eqreg.php and the logic to support it to insert.php

- The script now emails the user as well as the admin so the user gets a confirmation. ** Make sure you change the Bcc: address to your email address. **

- Updated error handling so all errors have a link to direct the user back to the main eqreg.php page to try again.

The code:

eqreg.php


<!-- EQEMu SVN Loginserver PHP Account Registration Page - By: Cubber -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict/EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>EQEmu SVN Loginserver Account Registration Page</title>

<meta name="description" content="EQEmulator SVN Loginserver Account Registration Page.">

</head>

<body>

<h1>EQ Registration Form</h1>
<p>Please fill out the form below to create a new account.</p>
<br />

<form method="post" action="insert.php">
Username: <i>(Max 16 chars)</i><br />
<input name="username" type="text" id="username" maxlength="16" />
<br /><br />
Password: <i>(Max 16 chars)</i><br />
<input name="pw" type="password" id="pw" maxlength="16" />
<br /><br />
Confirm Password: <i>(Max 16 chars)</i><br />
<input name="cpw" type="password" id="cpw" maxlength="16" />
<br /><br />
Email:<br />
<input name="email" type="text" id="email" maxlength="50" />
<br /><br />
<br />
<input name="Submit" type="submit" value="Create Account" />
</form>
<br />


</body>
</html>



insert.php


<!-- EQEMu SVN Loginserver PHP Account Registration Page - By: Cubber -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict/EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>>EQEmu SVN Loginserver Account Registration Page</title>

<meta name="description" content="EQEmulator SVN Loginserver Account Registration Page.">

<head>

<body>

<p>
<?php
$DB_ADDY = "localhost"; //address:port for the MySQL server
$DB_USER = "eqemu"; //username to login to MySQL with
$DB_PASS = "eqemu"; //password to login to MySQL with
$DB_DB = "peq"; //database name to use "peq" for default installation
$user = $_POST['username'];
$pass = $_POST['pw'];
$cpass = $_POST['cpw'];
$acct_email = $_POST['email'];
$headers = 'Bcc: admin@somewhere.com' . "\r\n";
$sendto = $acct_email;
$subject = "New EQ Account Created";
$message = "Your new account has been created on the EQEmulator Server. Account details:\n email: $acct_email\n username: $user\n password: $pass\n";

function error_s($text)
{
echo("<p>" . $text);
};

$user_chars = "#[^a-zA-Z0-9_\-]#";
$email_chars = "/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/";

if ( !isset($_POST['username']) || !isset($_POST['pw']) || !isset($_POST['cpw']) || !isset($_POST['email']) )
{
echo "User/Pass/Email not passed. Click <a href=eqreg.php>here</a> and try again.";
return;
}

$con = @mysql_connect($DB_ADDY, $DB_USER, $DB_PASS);
if (!$con)
{
error_s("Unable to connect to database: " . mysql_error());
};

if (!empty($_POST))
{
if ((empty($_POST["username"]))||(empty($_POST["pw"]))||(empty($_POST["cpw"]))||(empty($_POST["email"])) )
{
error_s("You did not enter all the required information. Click <a href=eqreg.php>here</a> and try again.");
exit();
}
else
{

$username = ($_POST["username"]);
$pw = ($_POST["pw"]);
$cpw = ($_POST["cpw"]);
$email = ($_POST["email"]);

if (strlen($username) < 5)
{
error_s("Username too short. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (strlen($username) > 16)
{
error_s("Username too long. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (strlen($pw) < 6)
{
error_s("Password too short. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (strlen($pw) > 16)
{
error_s("Password too long. Click <a href=eqreg.php>here</a> and try again.");
exit();
};
if (strlen($cpw) < 6)
{
error_s("Password too short. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (strlen($cpw) > 16)
{
error_s("Password too long. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (strlen($email) < 10)
{
error_s("Email was too short. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (strlen($email) > 50)
{
error_s("Email was too long. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (preg_match($user_chars,$username))
{
error_s("Username contained illegal characters. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (preg_match($user_chars,$pw))
{
error_s("Password contained illegal characters. Click <a href=eqreg.php>here</a> and try again.");
exit();
};
if (preg_match($user_chars,$cpw))
{
error_s("Password contained illegal characters. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (!preg_match($email_chars,$email))
{
error_s("Email was in an incorrect format. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if ($pw != $cpw)
{
error_s("Passwords do not match! Click <a href=eqreg.php>here</a> and try again.");
exit();
}

$username = mysql_real_escape_string($username);
$pw = mysql_real_escape_string($pw);
$email = mysql_real_escape_string($email);
$qry = @mysql_query("select AccountName from " . mysql_real_escape_string($DB_DB) . ".tblLoginServerAccounts where AccountName = '" . $username . "'", $con);
if (!$qry)
{
error_s("Error querying database: " . mysql_error());
};

if ($existing_username = mysql_fetch_assoc($qry))
{
foreach ($existing_username as $key => $value)
{
$existing_username = $value;
};
};

$existing_username = ($existing_username);
if ($existing_username == ($_POST['username']))
{
error_s("That username is already taken. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

unset($qry);

$sha_pass_hash = sha1(($pw));
$register_sql = "insert into " . mysql_real_escape_string($DB_DB) . ".tblLoginServerAccounts (AccountName,AccountPassword,AccountEmail) values ('" . $username . "','" . $sha_pass_hash . "','" . $email . "')";
$qry = @mysql_query($register_sql, $con);
if (!$qry)
{
error_s("Error creating account: " . mysql_error());
}

else
{
mail($sendto, $subject, $message, $headers);
echo("Your account was successfully created!");
}

exit();
};

}

else
{
echo($page);
};

?>
</p>

</body>
</html>

cubber
04-06-2010, 05:22 PM
Here is a password reset tool I whipped up today for use with the SVN Login Server.

Same deal as the account creation tool, I stripped it down so it could be customized easily. Make sure to change the mysql info as well as the admin@somewhere.com to your email address. **Note: admin email is lower in the code.**

This script will email a confirmation to the user as well as Bcc the server admin once you change the Bcc: address. Once you verify it is working you may want to remove the $header from the mail line if you don't want users passwords mailed to you when they change them.


pwreset.php


<!-- EQEmulator SVN Login Server Account Password Reset Utility - By: Cubber -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict/EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>EQEmulator SVN Login Server Account Password Reset Utility</title>

<meta name="description" content="EQEmulator SVN Login Server Account Password Reset Utility.">

</head>

<body>

<h1>Password Reset Utility</h1>
<p>Please fill out the form below to change your login server password.</p>
<br />

<form method="post" action="insert.php">
Username: <i>(Max 16 chars)</i><br />
<input name="username" type="text" id="username" maxlength="16" />
<br /><br />
Current Password: <i>(Max 16 chars)</i><br />
<input name="pw" type="password" id="pw" maxlength="16" />
<br /><br />
New Password: <i>(Max 16 chars)</i><br />
<input name="npw" type="password" id="npw" maxlength="16" />
<br /><br />
Confirm New Password: <i>(Max 16 chars)</i><br />
<input name="cnpw" type="password" id="cnpw" maxlength="16" />
<br /><br />
<input name="Submit" type="submit" value="Change Password" />
</form>
<br />
</body>
</html>




insert.php


<!-- EQEmulator SVN Login Server Account Password Reset Utility - By: Cubber -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict/EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>EQEmulator SVN Login Server Account Password Reset Utility</title>

<meta name="description" content="EQEmulator SVN Login Server Account Password Reset Utility.">

<head>

<body>

<p>
<?php
$DB_ADDY = "localhost"; //address:port for the MySQL server
$DB_USER = "eqemu"; //username to login to MySQL with
$DB_PASS = "eqemu"; //password to login to MySQL with
$DB_DB = "peq"; //database name to use "peq" for default installation
$user = $_POST['username'];
$pass = $_POST['pw'];
$npass = $_POST['npw'];
$cnpass = $_POST['cnpw'];


function error_s($text)
{
echo("<p>" . $text);
};

$user_chars = "#[^a-zA-Z0-9_\-]#";

if ( !isset($_POST['username']) || !isset($_POST['pw']) || !isset($_POST['npw']) || !isset($_POST['cnpw']) )
{
echo "User/Pass/Email not passed. Click <a href=pwreset.php>here</a> and try again.";
return;
}

$con = @mysql_connect($DB_ADDY, $DB_USER, $DB_PASS);
if (!$con)
{
error_s("Unable to connect to database: " . mysql_error());
};

if (!empty($_POST))
{
if ((empty($_POST["username"]))||(empty($_POST["pw"]))||(empty($_POST["npw"]))||(empty($_POST["cnpw"])) )
{
error_s("You did not enter all the required information. Click <a href=pwreset.php>here</a> and try again.");
exit();
}
else
{

$username = ($_POST["username"]);
$pw = ($_POST["pw"]);
$npw = ($_POST["npw"]);
$cnpw = ($_POST["cnpw"]);

if (strlen($username) < 5)
{
error_s("Username too short. Click <a href=pwreset.php>here</a> and try again.");
exit();
};

if (strlen($username) > 16)
{
error_s("Username too long. Click <a href=pwreset.php>here</a> and try again.");
exit();
};

if (strlen($pw) < 6)
{
error_s("Password too short. Click <a href=pwreset.php>here</a> and try again.");
exit();
};

if (strlen($pw) > 16)
{
error_s("Password too long. Click <a href=pwreset.php>here</a> and try again.");
exit();
};

if (strlen($npw) < 6)
{
error_s("New password too short. Click <a href=pwreset.php>here</a> and try again.");
exit();
};

if (strlen($npw) > 16)
{
error_s("New password too long. Click <a href=pwreset.php>here</a> and try again.");
exit();
};

if (strlen($cnpw) < 6)
{
error_s("New password too short. Click <a href=pwreset.php>here</a> and try again.");
exit();
};

if (strlen($cnpw) > 16)
{
error_s("New password too long. Click <a href=pwreset.php>here</a> and try again.");
exit();
};

if (preg_match($user_chars,$username))
{
error_s("Username contained illegal characters. Click <a href=pwreset.php>here</a> and try again.");
exit();
};

if (preg_match($user_chars,$pw))
{
error_s("Password contained illegal characters. Click <a href=pwreset.php>here</a> and try again.");
exit();
};

if (preg_match($user_chars,$npw))
{
error_s("New password contained illegal characters. Click <a href=pwreset.php>here</a> and try again.");
exit();
};

if (preg_match($user_chars,$cnpw))
{
error_s("New password contained illegal characters. Click <a href=pwreset.php>here</a> and try again.");
exit();
};

if ($npw != $cnpw)
{
error_s("Passwords do not match! Click <a href=pwreset.php>here</a> and try again.");
exit();
}

$username = mysql_real_escape_string($username);
$pw = mysql_real_escape_string($pw);
$npw = mysql_real_escape_string($npw);
$cnpw = mysql_real_escape_string($cnpw);
$qry = @mysql_query("select AccountName from " . mysql_real_escape_string($DB_DB) . ".tblLoginServerAccounts where AccountName = '" . $username . "'", $con);
if (!$qry)
{
error_s("Error querying database: " . mysql_error());
};

if ($existing_username = mysql_fetch_assoc($qry))
{
foreach ($existing_username as $key => $value)
{
$existing_username = $value;
};
};

$pwqry = @mysql_query("select AccountPassword from " . mysql_real_escape_string($DB_DB) . ".tblLoginServerAccounts where AccountName = '" . $username . "'", $con);
if (!$pwqry)
{
error_s("Error querying database: " . mysql_error());
};

if ($pw_check = mysql_fetch_assoc($pwqry))
{
foreach ($pw_check as $key => $value)
{
$pw_check = $value;
};
};

$sha_oldpass_hash = sha1(($pw));
if ($sha_oldpass_hash != $pw_check)
{
error_s("Your account password was incorrect Click <a href=pwreset.php>here</a> and try again.");
exit();
}

$existing_username = ($existing_username);
if ($existing_username == ($_POST['username']))
{
$sha_pass_hash = sha1(($npw));
$register_sql = "UPDATE " . mysql_real_escape_string($DB_DB) . ".tblLoginServerAccounts SET AccountPassword='$sha_pass_hash' WHERE AccountName='$username' ";
};

$mailqry = @mysql_query("select AccountEmail from " . mysql_real_escape_string($DB_DB) . ".tblLoginServerAccounts where AccountName = '" . $username . "'", $con);
if (!$mailqry)
{
error_s("Error querying database: " . mysql_error());
};

if ($acct_email = mysql_fetch_assoc($mailqry))
{
foreach ($acct_email as $key => $value)
{
$acct_email = $value;
};
};

$headers = 'Bcc: admin@somewhere.com' . "\r\n";
$sendto = $acct_email;
$subject = "Your Login Server Password Has Been Changed";
$message = "Your Login Server password for the EQEmulator game server has been changed. Account details:\n username: $user\n password: $npass\n";
unset($mailqry);
unset($qry);
unset($pwqry);

$qry = @mysql_query($register_sql, $con);
if (!$qry)
{
error_s("Error changing password: " . mysql_error());
}
else
{
mail($sendto, $subject, $message, $headers);
echo("Your password was successfully changed!");
};

exit();
};
}
else
{
echo($page);
};

?>
</p>
</body>
</html>

cubber
04-13-2010, 01:06 PM
Here is a modified version that was requested by Akkadius in PM.

It allows a user to input their current Public EQEmulator LS account for servers that support both login methods, so that the two servers can be synced and users can use both to login to their account. Note this is optional and if the space is left empty it will just assign the next available ID in the DB. This probably can be improved on more, I just don't have the time right now, got a baby on the way in the next week or so...

eqreq.php


<!-- EQEMu SVN Loginserver PHP Account Registration Page - By: Cubber -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict/EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>EQEmu SVN Loginserver Account Registration Page</title>

<meta name="description" content="EQEmulator SVN Loginserver Account Registration Page.">

</head>

<body>

<h1>EQ Registration Form</h1>
<p>Please fill out the form below to create a new account.</p>
<br />

<form method="post" action="insert.php">
Username: <i>(Max 16 chars)</i><br />
<input name="username" type="text" id="username" maxlength="16" />
<br /><br />
Password: <i>(Max 16 chars)</i><br />
<input name="pw" type="password" id="pw" maxlength="16" />
<br /><br />
Confirm Password: <i>(Max 16 chars)</i><br />
<input name="cpw" type="password" id="cpw" maxlength="16" />
<br /><br />
Email:<br />
<input name="email" type="text" id="email" maxlength="50" />
<br /><br />
<font color=green><i>Optional</i></font><br />
Current EQEmulator Pubic<br />
Login Server Account Number:<br />
<input name="optls" type="text" id="optls" size="10" maxlength="10" />
<br /><br />
<br />
<input name="Submit" type="submit" value="Create Account" />
</form>
<br />


</body>
</html>



insert.php



<!-- EQEMu SVN Loginserver PHP Account Registration Page - By: Cubber -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict/EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>>EQEmu SVN Loginserver Account Registration Page</title>

<meta name="description" content="EQEmulator SVN Loginserver Account Registration Page.">

<head>

<body>

<p>
<?php
$DB_ADDY = "localhost"; //address:port for the MySQL server
$DB_USER = "eqemu"; //username to login to MySQL with
$DB_PASS = "eqemu"; //password to login to MySQL with
$DB_DB = "peq"; //database name to use "peq" for default installation
$user = $_POST['username'];
$pass = $_POST['pw'];
$cpass = $_POST['cpw'];
$acct_email = $_POST['email'];
$optls = $_POST['optls'];
$headers = 'Bcc: admin@somewhere.com' . "\r\n";
$sendto = $acct_email;
$subject = "New EQ Account Created";
$message = "Your new account has been created on the EQEmulator Server. Account details:\n email: $acct_email\n username: $user\n password: $pass\n";

function error_s($text)
{
echo("<p>" . $text);
};

$user_chars = "#[^a-zA-Z0-9_\-]#";
$email_chars = "/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/";

if ( !isset($_POST['username']) || !isset($_POST['pw']) || !isset($_POST['cpw']) || !isset($_POST['email']) )
{
echo "User/Pass/Email not passed. Click <a href=eqreg.php>here</a> and try again.";
return;
}

$con = @mysql_connect($DB_ADDY, $DB_USER, $DB_PASS);
if (!$con)
{
error_s("Unable to connect to database: " . mysql_error());
};

if (!empty($_POST))
{
if ((empty($_POST["username"]))||(empty($_POST["pw"]))||(empty($_POST["cpw"]))||(empty($_POST["email"])) )
{
error_s("You did not enter all the required information. Click <a href=eqreg.php>here</a> and try again.");
exit();
}
else
{

$username = ($_POST["username"]);
$pw = ($_POST["pw"]);
$cpw = ($_POST["cpw"]);
$email = ($_POST["email"]);
$optls = ($_POST["optls"]);

if (strlen($username) < 5)
{
error_s("Username too short. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (strlen($username) > 16)
{
error_s("Username too long. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (strlen($pw) < 6)
{
error_s("Password too short. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (strlen($pw) > 16)
{
error_s("Password too long. Click <a href=eqreg.php>here</a> and try again.");
exit();
};
if (strlen($cpw) < 6)
{
error_s("Password too short. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (strlen($cpw) > 16)
{
error_s("Password too long. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (strlen($email) < 10)
{
error_s("Email was too short. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (strlen($email) > 50)
{
error_s("Email was too long. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (preg_match($user_chars,$username))
{
error_s("Username contained illegal characters. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (preg_match($user_chars,$pw))
{
error_s("Password contained illegal characters. Click <a href=eqreg.php>here</a> and try again.");
exit();
};
if (preg_match($user_chars,$cpw))
{
error_s("Password contained illegal characters. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if (!preg_match($email_chars,$email))
{
error_s("Email was in an incorrect format. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

if ($pw != $cpw)
{
error_s("Passwords do not match! Click <a href=eqreg.php>here</a> and try again.");
exit();
}

$username = mysql_real_escape_string($username);
$pw = mysql_real_escape_string($pw);
$email = mysql_real_escape_string($email);
$optls = mysql_real_escape_string($optls);
$qry = @mysql_query("select AccountName from " . mysql_real_escape_string($DB_DB) . ".tblLoginServerAccounts where AccountName = '" . $username . "'", $con);
if (!$qry)
{
error_s("Error querying database: " . mysql_error());
};

if ($existing_username = mysql_fetch_assoc($qry))
{
foreach ($existing_username as $key => $value)
{
$existing_username = $value;
};
};

$existing_username = ($existing_username);
if ($existing_username == ($_POST['username']))
{
error_s("That username is already taken. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

unset($qry);

if($optls != "")
{
$lsqry = @mysql_query("select LoginServerID from " . mysql_real_escape_string($DB_DB) . ".tblLoginServerAccounts where LoginServerID = '" . $optls . "'", $con);
if (!$lsqry)
{
error_s("Error querying database: " . mysql_error());
};

if ($existing_lsaccount = mysql_fetch_assoc($lsqry))
{
foreach ($existing_lsaccount as $key => $value)
{
$existing_lsaccount = $value;
};
};

$existing_lsaccount = ($existing_lsaccount);

if ($existing_lsaccount == ($_POST['optls']))
{
error_s("That login server account ID is already taken. Click <a href=eqreg.php>here</a> and try again.");
exit();
};

unset($qry);
}

$sha_pass_hash = sha1(($pw));
if($optls == "")
{
$register_sql = "insert into " . mysql_real_escape_string($DB_DB) . ".tblLoginServerAccounts (AccountName,AccountPassword,AccountEmail) values ('" . $username . "','" . $sha_pass_hash . "','" . $email . "')";
}
else
{
$register_sql = "insert into " . mysql_real_escape_string($DB_DB) . ".tblLoginServerAccounts (LoginServerID,AccountName,AccountPassword,Account Email) values ('" . $optls . "','" . $username . "','" . $sha_pass_hash . "','" . $email . "')";
}

$qry = @mysql_query($register_sql, $con);
if (!$qry)
{
error_s("Error creating account: " . mysql_error());
}

else
{
mail($sendto, $subject, $message, $headers);
echo("Your account was successfully created!");
}

exit();
};

}

else
{
echo($page);
};

?>
</p>

</body>
</html>

cubber
04-13-2010, 03:03 PM
I started a googlecode page for my SVN Login Server PHP Utilities here:

https://code.google.com/p/eqemuphplsutils/source/checkout

Note in the registration folder there is an eqreg.php and an eqreg_optional.php. Same with the insert files.

The optional versions are for those that want to use the dual login server version, otherwise if you don't use the public LS just use the regular version. If you do decide to use the optional version make sure to remove the _optional from both the eqreg_optional.php and insert_optional.php and rename them to just eqreg.php and insert.php, since the code within calls for those filenames.

Dibzahab
05-15-2010, 10:25 AM
Late to the party, I know, but I thought I'd note that there's bug in the state-machine tokenizer that the loginserver uses. It skips characters containing some punctuation marks. I don't have the code in front of me now, but I'm certain that exlamation marks, at least, are not being properly parsed. This is using the CVS that I pulled down yesterday (5/14/10).

Cheers

KLS
05-15-2010, 01:28 PM
Not a bug per se just not implemented into the lexical analyzer as valid input. If you throw down a small list of punctuation that should work I'll add it though.

Dibzahab
05-18-2010, 01:21 AM
Not a bug per se just not implemented into the lexical analyzer as valid input. If you throw down a small list of punctuation that should work I'll add it though.

If it's invalid input, don't you think that it needs to be logged rather than silently discarded? Someone earlier in this thread thought it was voodoo that his password of 1111111 was the only one that worked. It's a bug.

KLS
05-18-2010, 02:59 AM
Could add logging, doesn't change the fact behind it. Acceptable characters were explicitly defined, which means if it doesn't work it's not bugged it's simply not implemented.

Now we can change that or you can continue to argue specifics.

KLS
05-18-2010, 01:29 PM
PS I went and changed it.

cubber
07-31-2010, 01:27 PM
I am having an issue with compiling the newer versions of the login server on gentoo linux. The most recent sources I have tried are from rev 1616

This is the error I get when I run make.



make

ccache gcc -c -Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wno-deprecated -Wcomment -Wcast-align -O -g -march=i686 -pthread -pipe -DEQLAUNCH -DEQDEBUG=5 -I/usr/include/mysql -pipe -fomit-frame-pointer -DHAVE_ERRNO_AS_DEFINE=1 -fno-strict-aliasing Client.cpp -o Client.o
In file included from LoginServer.h:27,
from Client.cpp:20:
Options.h: In constructor 'Options::Options()':
Options.h:168: warning: 'Options::local_network' will be initialized after
Options.h:166: warning: 'bool Options::reject_duplicate_servers'
Options.h:31: warning: when initialized here
Client.cpp: In member function 'void Client::Handle_SessionReady(const char*, unsigned int)':
Client.cpp:130: error: 'LoginMode' is not a class or namespace
make: *** [Client.o] Error 1

pfyon
07-31-2010, 01:41 PM
I posted a diff that fixed the issue for me: http://www.eqemulator.org/forums/showpost.php?p=189371&postcount=2

cubber
07-31-2010, 03:43 PM
That worked perfectly thanks!

RussellAllison
12-24-2010, 07:16 AM
I ran dependancy walker on eqemuloginserver.exe
it came up with two missing dll's
wer.dll and
ieshims.dll

i found wer.dll online, and now it's missing nvcrypt.dll

i found nvcrypt.dll and now it's missing bcrypt.dll.....

hi,

You can go to this site "fix-all-dll-errors.com"
This will solve your dll file problem. :)

ProSkeptic
02-26-2012, 08:23 PM
I am trying to compile it under Ubuntu 11.10 32-bit.

I copied the lib's for the linux up to the EQEmuLoginServer directory (I think that would be needed).
But I got the entire think out from the latest trunk as of yesterday (2012-02-25).

My error is

In file included from LoginServer.h:27:0,
from Client.cpp:20:
Options.h: In constructor ‘Options::Options()’:
Options.h:168:9: warning: ‘Options::local_network’ will be initialized after [-Wreorder]
Options.h:166:7: warning: ‘bool Options::reject_duplicate_servers’ [-Wreorder]
Options.h:31:2: warning: when initialized here [-Wreorder]
Client.cpp: In member function ‘void Client::Handle_SessionReady(const char*, unsigned int)’:
Client.cpp:130:27: error: ‘LoginMode’ is not a class or namespace
make: *** [Client.o] Error 1

Oh, and is there a location where / how to use the EQEmuLoginServer? I haven't done this since the old days of running minilogin in Windows.

KLS
02-26-2012, 10:40 PM
http://www.eqemulator.org/forums/showthread.php?t=33639 addresses this issue.