Mycal
Staff member
I'm going to keep this short since the last 3 times I've started typing this, it got really long for a journal entry.
I have been working on so many different things it's hard to document all of them accurately, but the biggest things I've been working on is Sockets, Database, and the Script Engine.
I'm utilizing a socket library called Lidgren. I've hit some snags with IPv6 addresses though. For some reason my windows 8 machine isn't playing nicely with opening a listening socket. I've worked around this, but the same socket doesn't work on windows 7. It's silly and I'm sure there's a simple solution, but I've been putting it off.
I've also been working on the database. As some of you know, ody currently uses a MS Access '97 database. Because I'm updating everything, I decided to convert the database over to SQLite. I choose SQLite because it's OS independent and it's portable, similar to the Access database. I started to update the table layouts to use a more sensible approach, but code conversion slowed down greatly since I could no longer just 1:1 code convert. So I moved this off to a separate branch in my source control and I'll continue with that later. For now, I'll keep ody's structure for the most part with one majorly drastic change. I've completely de-normalized the Map table and moved tiles into a separate table.
Last but most certainly not least, the script engine. Ody currently uses a kind of vb like script code. I've mentioned this, but this is the one thing I did not receive from Steverino when he handed the source over. I think this is because Bugaboo was the one with the code and he provided updates as needed. I have no source on this just old AIM chat logs that lead me to this conclusion. Anyway, because of this it's difficult to hook it into C#. I can do it, but it instantly becomes locked to windows only and the code is unmanaged. I want to avoid this so I announced early on that I am switching the script engine over to Lua. This has been very successful and adds a lot of new power that you did not have before.
What I have been working on is something I originally decided to put off for much later. The script converter. This has been more fun a process than I originally expected. For the interested, I'm using xml to define the language rules and using regular expression to convert them. Basically, I take a script randomly from an old server, I run it through the converter and look for errors. If there are none, I move on. To give you an idea of what the converted code looks like, here is a sample script I did just a moment ago which actually is a very helpful example as I'll explain in the second post to this thread. This is a flat conversion with no extras. A lot of the functions here will need to be converted as well, I just haven't coded those yet.
I have been working on so many different things it's hard to document all of them accurately, but the biggest things I've been working on is Sockets, Database, and the Script Engine.
I'm utilizing a socket library called Lidgren. I've hit some snags with IPv6 addresses though. For some reason my windows 8 machine isn't playing nicely with opening a listening socket. I've worked around this, but the same socket doesn't work on windows 7. It's silly and I'm sure there's a simple solution, but I've been putting it off.
I've also been working on the database. As some of you know, ody currently uses a MS Access '97 database. Because I'm updating everything, I decided to convert the database over to SQLite. I choose SQLite because it's OS independent and it's portable, similar to the Access database. I started to update the table layouts to use a more sensible approach, but code conversion slowed down greatly since I could no longer just 1:1 code convert. So I moved this off to a separate branch in my source control and I'll continue with that later. For now, I'll keep ody's structure for the most part with one majorly drastic change. I've completely de-normalized the Map table and moved tiles into a separate table.
Last but most certainly not least, the script engine. Ody currently uses a kind of vb like script code. I've mentioned this, but this is the one thing I did not receive from Steverino when he handed the source over. I think this is because Bugaboo was the one with the code and he provided updates as needed. I have no source on this just old AIM chat logs that lead me to this conclusion. Anyway, because of this it's difficult to hook it into C#. I can do it, but it instantly becomes locked to windows only and the code is unmanaged. I want to avoid this so I announced early on that I am switching the script engine over to Lua. This has been very successful and adds a lot of new power that you did not have before.
What I have been working on is something I originally decided to put off for much later. The script converter. This has been more fun a process than I originally expected. For the interested, I'm using xml to define the language rules and using regular expression to convert them. Basically, I take a script randomly from an old server, I run it through the converter and look for errors. If there are none, I move on. To give you an idea of what the converted code looks like, here is a sample script I did just a moment ago which actually is a very helpful example as I'll explain in the second post to this thread. This is a flat conversion with no extras. A lot of the functions here will need to be converted as well, I just haven't coded those yet.
Code:
----------------- joingame -----------------
function joingame(player,god)
local x, xx, xxx, a, b, c
playermessage(player,"Welcome! Server is still under some construction.",brightblue)
setplayerflag(player,11,0)
if GetPlayerFlag(Player,62) == 1 then
setplayerflag(player,62,0)
PlayerMessage(Player,"You have been removed from the ladder!",yellow)
end
setplayerflag(player,6,0)
setplayerflag(player,7,0)
--[[
for a = 0 to getmaxusers
if isplaying(a) then 'and getplayeraccess(a) = 0 and getplayeraccess(player) = 0 and getplayeraccess(a) == 0 then
if strcmp(getplayerip(player),getplayerip(a)) and player ~= a then
timer(player,1,"multiboot")
end
end
end
]]--
if getplayerflag(player,1) == 0 then
setplayerflag(player,1,1)
setflag(1,getflag(1)+1)
globalmessage(strcat("Current Population: ",str(getflag(1))),cyan)
for god = 1 to getmaxusers
if getplayeraccess(god) => 50 then
if getplayeraccess(player) > 0 then
return false
else
playermessage(god,strcat(strcat(getplayername(player),"-- s IP address is: "),getplayerip(player)),white)
end
end
end
else
playermessage(player,strcat("Current Population: ",str(getflag(1))),cyan)
for god = 1 to getmaxusers
if getplayeraccess(god) => 50 then
if getplayeraccess(player) > 0 then
playermessage(god,strcat4(getplayername(player)," has logged on: ",str(getplayerflag(player,2)), " times"),white)
else
playermessage(god,strcat(strcat(getplayername(player),"-- s IP address is: "),getplayerip(player)),white)
setplayerflag(player,2,getplayerflag(player,2)+1)
playermessage(god,strcat4(getplayername(player)," has logged on: ",str(getplayerflag(player,2)), " times"),white)
end
end
end
end
if getplayerflag(player,8) == 1 then
setplayerflag(player,8,0)
setplayerstatus(player,0)
end
if getplayerflag(player,28) == 1 then
setplayerflag(player,28,0)
playerwarp(player,2,5,4)
end
end