From The Mana World
(add more)
(rework structure of new Net)
Line 1: Line 1:
This is my plan for centralizing the net code under the merged client.
This is my plan for centralizing the net code under the merged client.


First, TMWServ's Net namespace needs to be changed (I vote for TMWserv as the new name). Then a new Net name space would be created to hide the details of the netcode (all the relevant #ifdefs). This allows us to move most (f not all) netcode out of the rest of the classes and better merge them. As we fix the netcode backends, only the functions in the Net namespace need to be changed. The methods in this namespace will probably be inlined, as they will eventually just call another method (in the majority of cases).
First, TMWServ's Net namespace needs to be changed (I vote for TMWserv as the new name). Then a new Net namespace would be created to store references to the specific network back-end needed.


Layout of the new Net namespace (this is a partial list, so please expand):
Here are the functions the generic back end needs (organized by type)


Net
Login
*Login
*Login(...)
**Login(...)
*ChangeEmail(...)
**ChangeEmail(...)
*ChangePassword(...)
**ChangePassword(...)
*ChooseServer(serverId)
**ChooseServer(serverId)


*Char
Char
**ChooseChar(number)
*ChooseChar(number)
**NewChar(...)
*NewChar(...)
**DeleteChar(number, ...)
*DeleteChar(number, ...)


*Chat
Chat
**Talk(text)
*Talk(text)
**Me(text)
*Me(text)
**Msg(recipient, text)
*Msg(recipient, text)
 
*Being
**Attack(beingId)


Being
*Attack(beingId)
*Player
*Player
*LocalPlayer
*LocalPlayer
**Emote(emoteId)
*Emote(emoteId)
**IncStat(statId)
*IncStat(statId)
**DecStat(statId)
*DecStat(statId)
**SendLetter(recipient, text)
*SendLetter(recipient, text)


*Inventory
Inventory
**Equip(slotNum)
*Equip(slotNum)
**Drop(slotNum, ammount)
*Drop(slotNum, ammount)
**Split(slotNum, ammount)
*Split(slotNum, ammount)


*NPC
NPC
**Talk(npcId)
*Talk(npcId)
**NextDialog(npcId)
*NextDialog(npcId)
**CloseDialog(npcId)
*CloseDialog(npcId)
**ListInput(npcId, value)
*ListInput(npcId, value)
**IntegerInput(npcId, value)
*IntegerInput(npcId, value)
**StringIntput(npcId, value)
*StringIntput(npcId, value)


*Shop
Shop
**Start(beingId)
*Start(beingId)
**Buy(beingId)
*Buy(beingId)
**Sell(beingId)
*Sell(beingId)
**BuyItem(beingId, itemId, ammount)
*BuyItem(beingId, itemId, ammount)
**SellItem(beingId, itemId, ammount)
*SellItem(beingId, itemId, ammount)
**End(beingId)
*End(beingId)


*Skill
Skill
**Up(skillId)
*Up(skillId)
**Use(skillId)
*Use(skillId)


*Trade
Trade
**Request(beingId)
*Request(beingId)
**AddItem(slotNum, ammount)
*AddItem(slotNum, ammount)
**RemoveItem(slotNum, ammount)
*RemoveItem(slotNum, ammount)
**SetMoney(ammount)
*SetMoney(ammount)
**Confirm()
*Confirm()
**Finish()
*Finish()
**Cancel()
*Cancel()


*Party
Party
**Create()
*Create()
**Join(partyId)
*Join(partyId)
**Leave()
*Leave()
**Kick(playerId)
*Kick(playerId)
**Chat(text)
*Chat(text)


*Guild
Guild
**Create()
*Create()
**Join(guildId)
*Join(guildId)
**Chat(text)
*Chat(text)


*Storage
Storage
**Open()
*Open()
**Close()
*Close()
**Store(slotId, ammount)
*Store(slotId, ammount)
**Retrieve(slotId, ammount)
*Retrieve(slotId, ammount)


*Admin/GM (what's a good name for this?)
Admin/GM
**Announce(text)
*Announce(text)
**Kick(id)
*Kick(id)
**Kick(name)
*Kick(name)
**Ban(id)
*Ban(id)
**Ban(name)
*Ban(name)
**...
*...

Revision as of 15:44, 24 March 2009

This is my plan for centralizing the net code under the merged client.

First, TMWServ's Net namespace needs to be changed (I vote for TMWserv as the new name). Then a new Net namespace would be created to store references to the specific network back-end needed.

Here are the functions the generic back end needs (organized by type)

Login

  • Login(...)
  • ChangeEmail(...)
  • ChangePassword(...)
  • ChooseServer(serverId)

Char

  • ChooseChar(number)
  • NewChar(...)
  • DeleteChar(number, ...)

Chat

  • Talk(text)
  • Me(text)
  • Msg(recipient, text)

Being

  • Attack(beingId)
  • Player
  • LocalPlayer
  • Emote(emoteId)
  • IncStat(statId)
  • DecStat(statId)
  • SendLetter(recipient, text)

Inventory

  • Equip(slotNum)
  • Drop(slotNum, ammount)
  • Split(slotNum, ammount)

NPC

  • Talk(npcId)
  • NextDialog(npcId)
  • CloseDialog(npcId)
  • ListInput(npcId, value)
  • IntegerInput(npcId, value)
  • StringIntput(npcId, value)

Shop

  • Start(beingId)
  • Buy(beingId)
  • Sell(beingId)
  • BuyItem(beingId, itemId, ammount)
  • SellItem(beingId, itemId, ammount)
  • End(beingId)

Skill

  • Up(skillId)
  • Use(skillId)

Trade

  • Request(beingId)
  • AddItem(slotNum, ammount)
  • RemoveItem(slotNum, ammount)
  • SetMoney(ammount)
  • Confirm()
  • Finish()
  • Cancel()

Party

  • Create()
  • Join(partyId)
  • Leave()
  • Kick(playerId)
  • Chat(text)

Guild

  • Create()
  • Join(guildId)
  • Chat(text)

Storage

  • Open()
  • Close()
  • Store(slotId, ammount)
  • Retrieve(slotId, ammount)

Admin/GM

  • Announce(text)
  • Kick(id)
  • Kick(name)
  • Ban(id)
  • Ban(name)
  • ...