• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Re-release] [Source] [v1.11] MapleGame C# Source rev 79

Nexon's undercover
Joined
Feb 24, 2010
Messages
430
Reaction score
167
I released this source before but lately I worked on it and added and fixed a few things.
Tomorrow I'm going to the army so I won't have time to keep working on it, but you could post your bug reports/suggestions and when I'll get home I might do them if I'll have the time.

Features list:
  • Login Server (channels, characters, pins, pics, etc..)
  • Characters (movements, attacks, skills, inventory and so on)
  • Mobs (everything)
  • NPCs (everything, codable)
  • Reactors (only the ones that breaks with normal attacks, I have no idea how the others work)
  • Quests (everything, codable)
  • Portals (everything, codable)
  • Shops
  • Storage
  • Misc (item cosumes, scrolls, serveral cash items, skill books, potentials, cubes)
  • Buddy List
  • Cash Shop (packeges, cash inventory, wish list, basically everything besides gifts)
  • Supports multi-worlds, each channel can be hosted on a different machine
  • Some source tools as the packet recorder
  • Player and admin commands

Some notes:
  • As for the NPCs, quests and portals, nothing is coded actually, each one have only one example
  • I didn't code any skills/buffs since v0.75, because in later versions they're completely change
  • Some of the features, I coded on previous versions of the games, so they're working but the packets aren't updated (such as buffs)
  • There is a new bug with equiping cash items, haven't touched it yet.

Credits:
  • LokiMS original developers, Moo, Rob and Emilyx3
  • OdinMS developers that I learned a lot from their code, mostly about how stuff works.
  • Hendi48 helped me a LOT, really everytime I needed
  • Diamondo25 also helped me with a lot of things
  • Some source that I took packets from (moople, xeonms, lithium)

Links:

Enjoy!
 
Last edited:
Elite Diviner
Joined
Apr 7, 2008
Messages
494
Reaction score
66
Updating Warning :
certain table is missing from Hendi Dumper in the latest version... example character_skin_data, cash_commodity_data isn't dump correctly
drops isnt there and certain table are certain missing which will make the maplegame unable to play..

Bugs As Of Rev 79
hyper body dont cast to mp only to hp
changing channel, entering cash shop, creating character cause System.ObjectDisposedException: Cannot access a disposed object.
(cause channel to crash)
quest items seems to be dropped even if the quest is not started or activated
found a crash bug -> spawn 100100 10000 and try to kill them using gm roar will cause System.NullReferenceException: Object reference not set to an instance of an object.
normal players are able to use /m
players dead are able to revive on the same map

Unimplemented
buff dont work error 38 due to its not updated
npc/reactor/quest/portal most scripts are not scripted at all


Improvment Suggested
cash shop should run on a separate interoperability
nx data reading should be added ? together alongside with mcdb reading
pic should be hashed
packets should be serpated ( Example LoginPackets,CashShopsPackets) and with the handler
autoban system
error38 log handler should be added.
scripts should be dynamic and coded via their names example hontale_keroben same for portal and reactor and npc..
 
Last edited:
Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
Beautiful



the most interesting issue is that certain table is missing from Hendi Dumper in the latest version... example character_skin_data, cash_commodity_data isn't dump correctly
it also seems to be following most of Vana stuff

Only thing is the MCDB usage.
Nuggyman I'm happy you kept on updating this, good job. It'd be nice if you included your update log since last time. However, I'd like to point out a few things.


  • I don't understand why isn't the Cash Shop a separated server? If you're having trouble making it work with the other servers, it's pretty easy and I can help with that (the interoperability part is probably the easiest part). Making it a separate server will reduce the load on the channel server and make things much more organized and use less data (For example, you don't need the whole character class's data. You only need certain stuff from it, so it's a waste to store such information).
  • I'm not sure about the speed of your dynamic MySQL data retriever. It seems pretty slow from what I've tested it. For example, logging in into an account should've took a mere second, but it took about 3 to 5 seconds on your emulator.
  • I think it's time to switch to NX :). It will reduce your load time dramatically.

Best of luck to you!
 
Last edited:
Elite Diviner
Joined
Apr 7, 2008
Messages
494
Reaction score
66
Only thing is the MCDB usage.

@op I'm happy you kept on updating this, good job. It'd be nice if you included your update log since last time.

Also, I don't understand why isn't the Cash Shop a separated server? If you're having trouble making it work with the other servers, it's pretty easy and I can help with that (the interoperability part is probably the easiest part). Making it a separate server will reduce the load on the channel server and make things more organized.

Fraysa

maybe you should fork it

this seems to be everywhere when you save character, tried to get into cash shop etc

2/13/2014 12:26:38 PM System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, SocketError& errorCode)
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Loki.Net.ServerHandler`3.Send(Packet outPacket)
at Loki.Interoperability.InteroperabilityClient.UpdateBuddies(Character character, Boolean initialize, Int32 buddyID)
at Loki.Net.ChannelClientHandler.Terminate()
at Loki.Net.ClientHandler`3.Dispose()

Bugs so far..

Code:
hyperbody dont cast to mp only to hp
buffing yourself seems to cause Error38 o.O
pressing okay when you die seems to cause relieve on the same map/same as you relog.
normal players are able to use /m command
there seems to be Dispose issue when saving characters

will update more bugs as I find it..
 
Last edited:
Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
Fraysa

maybe you should fork it

this seems to be everywhere when you save character, tried to get into cash shop etc

2/13/2014 12:26:38 PM System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, SocketError& errorCode)
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Loki.Net.ServerHandler`3.Send(Packet outPacket)
at Loki.Interoperability.InteroperabilityClient.UpdateBuddies(Character character, Boolean initialize, Int32 buddyID)
at Loki.Net.ChannelClientHandler.Terminate()
at Loki.Net.ClientHandler`3.Dispose()

also there is a bug ->

case (int)SkillNames.SuperGM.HyperBody:
this.SecondaryStatups.Add(SecondaryBuffStat.HyperBodyHP, skill.ParameterA);
this.SecondaryStatups.Add(SecondaryBuffStat.HyperBodyHP, skill.ParameterB);
break;

change the second one to SecondaryBuffStat.HyperBodyMP

The exception is thrown when sending data to the client but it's socket is already disposed. You can override this by checking if the client object is disposed or not, and if it's not then send the data. You can ignore this exception anyway.
 
Nexon's undercover
Joined
Feb 24, 2010
Messages
430
Reaction score
167
Only thing is the MCDB usage.
Nuggyman I'm happy you kept on updating this, good job. It'd be nice if you included your update log since last time. However, I'd like to point out a few things.


  • I don't understand why isn't the Cash Shop a separated server? If you're having trouble making it work with the other servers, it's pretty easy and I can help with that (the interoperability part is probably the easiest part). Making it a separate server will reduce the load on the channel server and make things much more organized and use less data (For example, you don't need the whole character class's data. You only need certain stuff from it, so it's a waste to store such information).
  • I'm not sure about the speed of your dynamic MySQL data retriever. It seems pretty slow from what I've tested it. For example, logging in into an account should've took a mere second, but it took about 3 to 5 seconds on your emulator.
  • I think it's time to switch to NX :). It will reduce your load time dramatically.

Best of luck to you!

1.I don't really see the point in doing so, the whole channel is loaded in 7 seconds so I don't really care.
2.It takes me less then a second lol
3.Again the whole channel is loaded in 7 seconds so I don't see the point in switching, one time I tried but I came across some annoying bugs.

Fraysa

maybe you should fork it

this seems to be everywhere when you save character, tried to get into cash shop etc

2/13/2014 12:26:38 PM System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, SocketError& errorCode)
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Loki.Net.ServerHandler`3.Send(Packet outPacket)
at Loki.Interoperability.InteroperabilityClient.UpdateBuddies(Character character, Boolean initialize, Int32 buddyID)
at Loki.Net.ChannelClientHandler.Terminate()
at Loki.Net.ClientHandler`3.Dispose()

Bugs so far..

Code:
hyperbody dont cast to mp only to hp
buffing yourself seems to cause Error38 o.O
pressing okay when you die seems to cause relieve on the same map/same as you relog.
normal players are able to use /m command
there seems to be Dispose issue when saving characters

will update more bugs as I find it..
1.I didn't code any skills/buffs since v0.75 so they might be buggy.
2.As I said the packets of buffs aren't updated.
3 and 4.I'll fix them next week.
5.I'll need more info.
 
Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
1.I don't really see the point in doing so, the whole channel is loaded in 7 seconds so I don't really care.
2.It takes me less then a second lol
3.Again the whole channel is loaded in 7 seconds so I don't see the point in switching, one time I tried but I came across some annoying bugs.


1.I didn't code any skills/buffs since v0.75 so they might be buggy.
2.As I said the packets of buffs aren't updated.
3 and 4.I'll fix them next week.
5.I'll need more info.

It doesn't matter, it's just things you will need to follow. The Cash Shop should be separated from the other servers as it doesn't use the data you're currently using. You're loading all of the character data, including skills, buffs, and so on, which shouldn't be even loaded. You can easily get it through the channel server using inter-server packets.

Also, I doubt it takes 7 seconds (well, maybe, because it's v111). Last time I tested it took about 17 seconds for v144, and even more loading the "strings" table. 7 seconds even is considered "big" loading time, you should really consider switching to NX (yes, I know it's a lot of work because eveything is already set to Sql format, but it's worth it). Your loading time will be reduced to about a few seconds (1 or 2) if you do so.
 
Elite Diviner
Joined
Apr 7, 2008
Messages
494
Reaction score
66
when you try to create a character you will get this

Channel

Code:
2/13/2014 11:56:58 AM System.ObjectDisposedException: Cannot access a disposed object.Object name: 'System.Net.Sockets.Socket'.
   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, SocketError& errorCode)
   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at Loki.Net.ServerHandler`3.Send(Packet outPacket)
   at Loki.Interoperability.InteroperabilityClient.SetCash(Int32 accountID, Int32 nx, Int32 maplepoints, Int32 paypal)
   at Loki.Maple.Characters.Character.Save()
   at Loki.Net.ChannelClientHandler.Terminate()
   at Loki.Net.ClientHandler`3.Dispose()


2/13/2014 11:56:58 AM System.ObjectDisposedException: Cannot access a closed Stream.
   at System.IO.__Error.StreamIsClosed()
   at System.IO.MemoryStream.set_Position(Int64 value)
   at Loki.IO.ByteBuffer.set_Position(Int32 value)
   at Loki.Net.ClientHandler`3.OnReceive(IAsyncResult ar)


and in Login

Code:
2/13/2014 12:29:35 PM Warning: Unregistered channel server Scania-1.


2/13/2014 12:37:52 PM MySql.Data.MySqlClient.MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE ID = '1'' at line 1
   at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
   at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
   at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
   at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId)
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
   at MySql.Data.MySqlClient.MySqlHelper.ExecuteNonQuery(MySqlConnection connection, String commandText, MySqlParameter[] commandParameters)
   at MySql.Data.MySqlClient.MySqlHelper.ExecuteNonQuery(String connectionString, String commandText, MySqlParameter[] parms)
   at Loki.Data.Database.Execute(String nonQuery, Object[] args)
   at Loki.Data.Datum.Update(String constraints, Object[] args)
   at CallSite.Target(Closure , CallSite , Object , String , Int32 )
   at Loki.Interoperability.ChannelServerHandler.SetCash(Packet inPacket)
   at Loki.Interoperability.ChannelServerHandler.Dispatch(Packet inPacket)
   at Loki.Net.ClientHandler`3.Handle(Byte[] rawPacket, Boolean fromCommand, Packet packet)
   at Loki.Net.ClientHandler`3.OnReceive(IAsyncResult ar)

also it would be nice if you could have something like this for unscript stuff and maybe a script folder -> npc,reactor,map,portal
https://subversion.assembla.com/svn/lobito/Log_Script_Except.txt < Unscript stuff
a script folder npc/reactor/map/portal etc..

also I find it very nice of this
nugyyman - [Re-release] [Source] [v1.11] MapleGame C# Source rev 79 - RaGEZONE Forums


well atleast it is way faster than loading in odin, I have no idea how long does Vana takes but it should be the same as Loki
 
Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
when you try to create a character you will get this

Channel

Code:
2/13/2014 11:56:58 AM System.ObjectDisposedException: Cannot access a disposed object.Object name: 'System.Net.Sockets.Socket'.
   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, SocketError& errorCode)
   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at Loki.Net.ServerHandler`3.Send(Packet outPacket)
   at Loki.Interoperability.InteroperabilityClient.SetCash(Int32 accountID, Int32 nx, Int32 maplepoints, Int32 paypal)
   at Loki.Maple.Characters.Character.Save()
   at Loki.Net.ChannelClientHandler.Terminate()
   at Loki.Net.ClientHandler`3.Dispose()


2/13/2014 11:56:58 AM System.ObjectDisposedException: Cannot access a closed Stream.
   at System.IO.__Error.StreamIsClosed()
   at System.IO.MemoryStream.set_Position(Int64 value)
   at Loki.IO.ByteBuffer.set_Position(Int32 value)
   at Loki.Net.ClientHandler`3.OnReceive(IAsyncResult ar)


and in Login

Code:
2/13/2014 12:29:35 PM Warning: Unregistered channel server Scania-1.


2/13/2014 12:37:52 PM MySql.Data.MySqlClient.MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE ID = '1'' at line 1
   at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
   at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
   at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
   at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId)
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
   at MySql.Data.MySqlClient.MySqlHelper.ExecuteNonQuery(MySqlConnection connection, String commandText, MySqlParameter[] commandParameters)
   at MySql.Data.MySqlClient.MySqlHelper.ExecuteNonQuery(String connectionString, String commandText, MySqlParameter[] parms)
   at Loki.Data.Database.Execute(String nonQuery, Object[] args)
   at Loki.Data.Datum.Update(String constraints, Object[] args)
   at CallSite.Target(Closure , CallSite , Object , String , Int32 )
   at Loki.Interoperability.ChannelServerHandler.SetCash(Packet inPacket)
   at Loki.Interoperability.ChannelServerHandler.Dispatch(Packet inPacket)
   at Loki.Net.ClientHandler`3.Handle(Byte[] rawPacket, Boolean fromCommand, Packet packet)
   at Loki.Net.ClientHandler`3.OnReceive(IAsyncResult ar)

also it would be nice if you could have something like this for unscript stuff and maybe a script folder -> npc,reactor,map,portal
https://subversion.assembla.com/svn/lobito/Log_Script_Except.txt < Unscript stuff
a script folder npc/reactor/map/portal etc..

This, and also scripts should be dynamic and not hardcoded. You can easily make them like this using C# and CodeDomProvider for this. I can show an example if needed.
 
Elite Diviner
Joined
Apr 7, 2008
Messages
494
Reaction score
66
found a bug quest items are being drop even if they are not started ? does this has to do with a change of gm job

nugyyman - [Re-release] [Source] [v1.11] MapleGame C# Source rev 79 - RaGEZONE Forums


found a crash bug -> spawn 100100 10000 and try to kill them using gm roar

server will crash

Code:
2/13/2014 2:08:21 PM System.NullReferenceException: Object reference not set to an instance of an object.
   at Loki.Maple.Life.Mob.SwitchController(Character newController)
   at Loki.Maple.Characters.Character.Attack(Packet inPacket, AttackType type)
   at Loki.Net.ChannelClientHandler.Dispatch(Packet inPacket)
   at Loki.Net.ClientHandler`3.Handle(Byte[] rawPacket, Boolean fromCommand, Packet packet)
   at Loki.Net.ClientHandler`3.OnReceive(IAsyncResult ar)

I have never seen anyone here so interested :\ maybe cause it is a server emulator from scratch or come to the point where it can destroy Odin..
overall the server seems rather very stable...

maybe there would be a fork like Vana would be cool if that happens just like the old days and after all I believe people would consider switching to loki after this.. as for the langange wise java and C# isnt far apart..

updated bug list @ post 2
so if anyone plans to fork this be sure to read this thread for the bugs issue..
 
Last edited:
Elite Diviner
Joined
Apr 7, 2008
Messages
494
Reaction score
66
@Fraysa

since you are a very good C# programmer

I believe you can start to contribute to the svn or start a fork project... Im sure there are some good C# programmers around here who knows it may be something..
 
Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
@Fraysa

since you are a very good C# programmer

I believe you can start to contribute to the svn or start a fork project... Im sure there are some good C# programmers around here who knows it may be something..

I'm already working on something of my own for a few months now. I rewrote it like 3 times because I made it better every time. I'll make it public once I have good progress, though.

Also, I think you misunderstood me. I never said anything bad about this project; I only said some constructive feedback, that's all.
 
Elite Diviner
Joined
Apr 7, 2008
Messages
494
Reaction score
66
well then maybe someone will make a fork of this.. would be great to look at..
 
Elite Diviner
Joined
Apr 7, 2008
Messages
494
Reaction score
66
You can pick it up if you want. Updating this to v146 shouldn't be that hard.. only packet-wise and maybe some more addons.

Updating to v146 would be the most stupid thing to do as of now the core is barely even working I have listed all the bugs I found earlier and besides I think retep had a point where he posted why update when most of the stuff isnt script or coded.. Updating isn't hard as it is only packet changes but that can only happen if you have a stable working core... So updating would take less effort then before

nuggyman there is also something wrong with your code

Code:
public void SetCash(Packet inPacket)        {
            int accountID = inPacket.ReadInt(), cash;


            dynamic datum = new Datum("accounts");


            cash = inPacket.ReadInt();
            if (cash != 0)
            {
                datum.CardNX = cash;
            }


            cash = inPacket.ReadInt();
            if (cash != 0)
            {
                datum.MaplePoints = cash;
            }


            cash = inPacket.ReadInt();
            if (cash != 0)
            {
                datum.PaypalNX = cash;
            }


            datum.Update("ID = '{0}'", accountID);
        }

uh I will try to fix up all the bugs :\ I encounter

Here I Fixed It :

Code:
public void SetCash(Packet inPacket)        {
            int accountID = inPacket.ReadInt(), cash;


            dynamic datum = new Datum("accounts");


            cash = inPacket.ReadInt();
            if (cash != 0)
            {
                datum.CardNX = cash;
                datum.Update("ID = '{0}'", accountID);
            }


            cash = inPacket.ReadInt();
            if (cash != 0)
            {
                datum.MaplePoints = cash;
                datum.Update("ID = '{0}'", accountID);
            }


            cash = inPacket.ReadInt();
            if (cash != 0)
            {
                datum.PaypalNX = cash;
                datum.Update("ID = '{0}'", accountID);
            }


        }

I have also fix the Dispose issue.. other other bugs so far..
 
Last edited:
Initiate Mage
Joined
Sep 8, 2009
Messages
2
Reaction score
7
shoftee

will you be contributing to the code at all ?

I might. Moreover... will you be doing so? I expected you to get right to it, seeing as you started posting your changes here instead of in a properly versioned system. What's stopping you?
 
Back
Top