erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 I'm making a guild system based of Samugames' one, but I've a problem.I have copy/paste all code from Samumods to a modified copy of EO, but the problem is that the client doesn't send/the server doesn't recieve the SendCreateGuild packet.After double checking all code I still not found the problem, please help.Code:**Server -> modEnumerations -> Public Enum Serverpackets/ClientPackets :**>! ' Packets sent by server to clientPublic Enum ServerPackets SAlertMsg = 1 SLoginOk SNewCharClasses SClassesData SInGame SPlayerInv SPlayerInvUpdate SPlayerWornEq SPlayerHp SPlayerMp SPlayerStats SPlayerData SPlayerMove SNpcMove SPlayerDir SNpcDir SPlayerXY SPlayerXYMap SAttack SNpcAttack SCheckForMap SMapData SMapItemData SMapNpcData SMapDone SGlobalMsg SAdminMsg SPlayerMsg SMapMsg SSpawnItem SItemEditor SUpdateItem SREditor SSpawnNpc SNpcDead SNpcEditor SUpdateNpc SMapKey SEditMap SShopEditor SUpdateShop SSpellEditor SUpdateSpell SSpells SLeft SResourceCache SResourceEditor SUpdateResource SSendPing SDoorAnimation SActionMsg SPlayerEXP SBlood SAnimationEditor SUpdateAnimation SAnimation SMapNpcVitals SCooldown SClearSpellBuffer SSayMsg SOpenShop SResetShopAction SStunned SMapWornEq SBank STrade SCloseTrade STradeUpdate STradeStatus SMaxLevel STarget SHotbar SHighIndex SSound SClearWhoList SUpdateWhoList STradeRequest SPartyInvite SPartyUpdate SPartyVitals SSpeechWindow SQuestEditor SUpdateQuest SPlayerQuest SQuestMessage 'Crzy's Friends List SFriendsList 'Guild things SSendClearGuildList SSendUpdateGuildList SSendGuildInvite SGuildMsg ' Make sure SMSG_COUNT is below everything else SMSG_COUNTEnd Enum>! ' Packets sent by client to serverPublic Enum ClientPackets CNewAccount = 1 CDelAccount CLogin CAddChar CUseChar CSayMsg CEmoteMsg CBroadcastMsg CPlayerMsg CPlayerMove CPlayerDir CUseItem CAttack CUseStatPoint CPlayerInfoRequest CWarpMeTo CWarpToMe CWarpTo CSetSprite CGetStats CRequestNewMap CMapData CNeedMap CMapGetItem CMapDropItem CMapRespawn CMapReport CKickPlayer CBanList CBanDestroy CBanPlayer CRequestEditMap CRequestEditItem CSaveItem CRequestEditNpc CSaveNpc CRequestEditShop CSaveShop CRequestEditSpell CSaveSpell CSetAccess CWhosOnline CSetMotd CSearch CSpells CCast CQuit CSwapInvSlots CRequestEditResource CSaveResource CCheckPing CUnequip CRequestPlayerData CRequestItems CRequestNPCS CRequestResources CSpawnItem CRequestEditAnimation CSaveAnimation CRequestAnimations CRequestSpells CRequestShops CRequestLevelUp CForgetSpell CCloseShop CBuyItem CSellItem CChangeBankSlots CDepositItem CWithdrawItem CCloseBank CAdminWarp CTradeRequest CAcceptTrade CDeclineTrade CTradeItem CUntradeItem CHotbarChange CHotbarUse CSwapSpellSlots CAcceptTradeRequest CDeclineTradeRequest CPartyRequest CAcceptParty CDeclineParty CPartyLeave CRequestEditQuest CSaveQuest CRequestQuests CPlayerHandleQuest CQuestLogUpdate 'Crzy's Friends System CFriendsList CAddFriend CRemoveFriend 'Guild things CSendCreateGuild CRequestGuildList CDismissFromGuild CSendAcceptGuildInvite CSendInviteToGuild CRequestUserList CGuildMsg ' Make sure CMSG_COUNT is below everything else CMSG_COUNTEnd Enum**Server -> modEnumerations -> Public Enum Serverpackets/ClientPackets :**>! ' Packets sent by server to clientPublic Enum ServerPackets SAlertMsg = 1 SLoginOk SNewCharClasses SClassesData SInGame SPlayerInv SPlayerInvUpdate SPlayerWornEq SPlayerHp SPlayerMp SPlayerStats SPlayerData SPlayerMove SNpcMove SPlayerDir SNpcDir SPlayerXY SPlayerXYMap SAttack SNpcAttack SCheckForMap SMapData SMapItemData SMapNpcData SMapDone SGlobalMsg SAdminMsg SPlayerMsg SMapMsg SSpawnItem SItemEditor SUpdateItem SREditor SSpawnNpc SNpcDead SNpcEditor SUpdateNpc SMapKey SEditMap SShopEditor SUpdateShop SSpellEditor SUpdateSpell SSpells SLeft SResourceCache SResourceEditor SUpdateResource SSendPing SDoorAnimation SActionMsg SPlayerEXP SBlood SAnimationEditor SUpdateAnimation SAnimation SMapNpcVitals SCooldown SClearSpellBuffer SSayMsg SOpenShop SResetShopAction SStunned SMapWornEq SBank STrade SCloseTrade STradeUpdate STradeStatus SMaxLevel STarget SHotbar SHighIndex SSound SClearWhoList SUpdateWhoList STradeRequest SPartyInvite SPartyUpdate SPartyVitals SSpeechWindow SQuestEditor SUpdateQuest SPlayerQuest SQuestMessage SCrafting 'Crzy's Friends System SFriendsList 'Guild system SSendClearGuildList SSendUpdateGuildList SSendGuildInvite SGuildMsg ' Make sure SMSG_COUNT is below everything else SMSG_COUNTEnd Enum>! ' Packets sent by client to serverPublic Enum ClientPackets CNewAccount = 1 CDelAccount CLogin CAddChar CUseChar CSayMsg CEmoteMsg CBroadcastMsg CPlayerMsg CPlayerMove CPlayerDir CUseItem CAttack CUseStatPoint CPlayerInfoRequest CWarpMeTo CWarpToMe CWarpTo CSetSprite CGetStats CRequestNewMap CMapData CNeedMap CMapGetItem CMapDropItem CMapRespawn CMapReport CKickPlayer CBanList CBanDestroy CBanPlayer CRequestEditMap CRequestEditItem CSaveItem CRequestEditNpc CSaveNpc CRequestEditShop CSaveShop CRequestEditSpell CSaveSpell CSetAccess CWhosOnline CSetMotd CSearch CSpells CCast CQuit CSwapInvSlots CRequestEditResource CSaveResource CCheckPing CUnequip CRequestPlayerData CRequestItems CRequestNPCS CRequestResources CSpawnItem CRequestEditAnimation CSaveAnimation CRequestAnimations CRequestSpells CRequestShops CRequestLevelUp CForgetSpell CCloseShop CBuyItem CSellItem CChangeBankSlots CDepositItem CWithdrawItem CCloseBank CAdminWarp CTradeRequest CAcceptTrade CDeclineTrade CTradeItem CUntradeItem CHotbarChange CHotbarUse CSwapSpellSlots CAcceptTradeRequest CDeclineTradeRequest CPartyRequest CAcceptParty CDeclineParty CPartyLeave CRequestEditQuest CSaveQuest CRequestQuests CPlayerHandleQuest CQuestLogUpdate CCrafting 'Crzy's Friends System CFriendsList CAddFriend CRemoveFriend 'Guild things CSendCreateGuild CRequestGuildList CDismissFromGuild CSendAcceptGuildInvite CSendInviteToGuild CRequestUserList CGuildMsg ' Make sure CMSG_COUNT is below everything else CMSG_COUNTEnd Enum>! Public HandleDataSub(CMSG_COUNT) As Long>! ' Stats used by Players, Npcs and ClassesPublic Enum Stats Strength = 1 Endurance Intelligence Agility Willpower ' Make sure Stat_Count is below everything else Stat_CountEnd Enum>! ' Vitals used by Players, Npcs and ClassesPublic Enum Vitals HP = 1 MP ' Make sure Vital_Count is below everything else Vital_CountEnd Enum **Client -> frmCreateGuild -> 'Create Guild' button :**>! Private Sub cmdCreate_Click()Dim n As Long Dim Buffer As clsBuffer Dim tmpGuildName As String Set Buffer = New clsBuffer Buffer.WriteLong CSendCreateGuild tmpGuildName = Me.txtGuildName.text Buffer.WriteString tmpGuildName SendData Buffer.ToArray() Set Buffer = Nothing Me.HideEnd Sub**Server -> modHandleData -> HandleCreateGuild :**>! Sub HandleCreateGuild(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim tmpGuildName As String>! Dim buffer As clsBufferSet buffer = New clsBufferbuffer.WriteBytes Data()tmpGuildName = buffer.ReadStringSet buffer = NothingCall CreateGuild(index, tmpGuildName)>! End SubIf you need more code or something else, reply or PM me. ;)Thanks for reading. Link to comment Share on other sites More sharing options...
goku1993 Posted June 11, 2011 Share Posted June 11, 2011 never seen Samugames's guild system but in order to help you i need to see the modservertcp for the screateguild code (which i don't see in the enumartion code so how could anything be sent or received? unless the invite will create the guild i don't know)edit:oh and for the modenumarions would be simpler to call SSendClearGuildList SClearGuildList since S Stands for Server or Send not sure which one but writing send is useless (just saying you don't have to change them)… Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Musbah:> need to see the modservertcp for the screateguild code> > edit:oh and for the modenumarions would be simpler to call SSendClearGuildList SClearGuildList since S Stands for Server or Send not sure which one but writing send is useless (just saying you don't have to change them)…I've included HandleCreateGuild, and I have no 'screateguild code' in modServerTCP. Link to comment Share on other sites More sharing options...
goku1993 Posted June 11, 2011 Share Posted June 11, 2011 Ok you handled create guild how do you send back to the client that it has been created and all??oh and i don't seeHandleDataSub(CSendCreateGuild) = GetAddress(AddressOf HandleCreateGuild) (if you didn't add it then well when you do everything should work unless something else is wrong) Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Musbah:> Ok you handled create guild how do you send back to the client that it has been created and all??> > oh and i don't see> > HandleDataSub(CSendCreateGuild) = GetAddress(AddressOf HandleCreateGuild) (if you didn't add it then well when you do everything should work unless something else is wrong)Createguild sub :```Public Sub CreateGuild(ByVal UserIndex As Integer, ByVal GuildName As String)'If the player sending the request is already in a guildIf Player(UserIndex).GuildID > 0 ThenCall PlayerMsg(UserIndex, "You are already in a guild!", BrightRed)Exit SubEnd If'Loop through all the guilds and see if any guild already has that nameDim i As IntegerFor i = 1 To NumGuilds If Guilds(i).Name = GuildName Then Call PlayerMsg(UserIndex, "That name is already in use!", BrightRed) Exit Sub End IfNext i'Make the GuildDim GuildIndex As IntegerNumGuilds = NumGuilds + 1GuildIndex = NumGuildsGuilds(GuildIndex).Name = GuildNameGuilds(GuildIndex).Founded = DateGuilds(GuildIndex).Owner = GetPlayerName(UserIndex)Guilds(GuildIndex).Gold = 0Guilds(GuildIndex).NumMembers = 1Guilds(GuildIndex).Members(1) = GetPlayerName(UserIndex)Player(UserIndex).GuildID = GuildIndexCall PlayerMsg(UserIndex, "Guild [" & GuildName & "] has been created!", BrightRed)'Save All GuildsCall SaveGuildsSendDataToAll PlayerData(UserIndex)End Sub```And HandleDataSub(CSend bla bla bla) is on server, should I add it on client too? Link to comment Share on other sites More sharing options...
goku1993 Posted June 11, 2011 Share Posted June 11, 2011 no just wanted to make sure it was in the server.i would add```sub sendcreateguild(byval guildname as string) Dim n As Long Dim Buffer As clsBuffer tmpGuildName = guildname Set Buffer = New clsBuffer Buffer.WriteLong CSendCreateGuild Buffer.WriteString tmpGuildName SendData Buffer.ToArray() Set Buffer = NothingEnd Sub```or something like that in modclienttcp then call the sub from the form i have no idea if that's causing the problem but tryOtherwise i can't really see anything wrong with the code in front of me that could stop client from sending to server or might be and i just can't see it, but sorry can't help you more than that with the code i got in front of me. Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Musbah:> no just wanted to make sure it was in the server.> > i would add> > ```> sub sendcreateguild(byval guildname as string)> Dim n As Long> Dim Buffer As clsBuffer> > tmpGuildName = guildname> > Set Buffer = New clsBuffer> Buffer.WriteLong CSendCreateGuild> > Buffer.WriteString tmpGuildName> > SendData Buffer.ToArray()> > Set Buffer = Nothing> End Sub> ```or something like that in modclienttcp then call the sub from the form i have no idea if that's causing the problem but try> > Otherwise i can't really see anything wrong with the code in front of me that could stop client from sending to server or might be and i just can't see it, but sorry can't help you more than that with the code i got in front of me.Ok, and there is no difference when I add that code in, its still saying : "You're not in a guild!" Link to comment Share on other sites More sharing options...
goku1993 Posted June 11, 2011 Share Posted June 11, 2011 Ok I'm not sure of this but since you'r adding something to the player shouldn't the create guild haveSaveplayer(userindex) cause if that's not saved it is going to say you're not in a guild… might be wrong too who knows Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Musbah:> Ok I'm not sure of this but since you'r adding something to the player shouldn't the create guild have> Saveplayer(userindex) cause if that's not saved it is going to say you're not in a guild… might be wrong too who knowsThat also don't work ;( Link to comment Share on other sites More sharing options...
goku1993 Posted June 11, 2011 Share Posted June 11, 2011 thing is if you're getting you'r not in a guild doesn't necessarily mean client isn't sending anything something could be wrong with the create guild or anything so try adding a message somewhere to see if something is sent or not. for example in handle create guild could add an alert to see if the code gets there or not (just an example). and while there pause and put your mouse on the integer see if the values are sent… Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Musbah:> thing is if you're getting you'r not in a guild doesn't necessarily mean client isn't sending anything something could be wrong with the create guild or anything so try adding a message somewhere to see if something is sent or not. for example in handle create guild could add an alert to see if the code gets there or not (just an example). and while there pause and put your mouse on the integer see if the values are sent…I did, the client is alright, but when I put a breakpoint at serveral point on server I get nothing.. Link to comment Share on other sites More sharing options...
goku1993 Posted June 11, 2011 Share Posted June 11, 2011 Sorry only thing i can think of is something wrong with handledatasub… Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Musbah:> Sorry only thing i can think of is something wrong with handledatasub…Here you've my modHandleData, please take a look at it. ;) Link to comment Share on other sites More sharing options...
damian666 Posted June 11, 2011 Share Posted June 11, 2011 make sure there is no typo, i once had a "Ssomethinghere" instead of "Csomethinghere" in server, that wont error, but also wont call the right code, took me a frikking day to notice xdDamidont see anything wrong, just put breakpoints everywhere, from the call to the sub, tru all of your sub, see where it fucks up Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Damian666:> make sure there is no typo, i once had a "Ssomethinghere" instead of "Csomethinghere" in server, that wont error, but also wont call the right code, took me a frikking day to notice xd> > Dami> > dont see anything wrong, just put breakpoints everywhere, from the call to the sub, tru all of your sub, see where it ducks upEverything seems to be alright there, and I already placed some breakpoint without any succes. Link to comment Share on other sites More sharing options...
damian666 Posted June 11, 2011 Share Posted June 11, 2011 yes, some, but i mean, flood the ducking bastard with them, check every single line so you can check everything for right data etc.thats your best bet mate, because while looking over it, nothing jumps up as wrong, so we can only know sure if we go in debug overkill xdso start in handlesub, then the sub that goes from there, then the createguild etc etc etcDami Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Damian666:> yes, some, but i mean, flood the ducking bastard with them, check every single line so you can check everything for right data etc.> > thats your best bet mate, because while looking over it, nothing jumps up as wrong, so we can only know sure if we go in debug overkill xd> > so start in handlesub, then the sub that goes from there, then the createguild etc etc etc> > DamiEverything is good at client, but server isn't recieving it. :( Link to comment Share on other sites More sharing options...
damian666 Posted June 11, 2011 Share Posted June 11, 2011 so its not even stopping on a breakpoint of the```HandleDataSub(CSendCreateGuild) = GetAddress(AddressOf HandleCreateGuild)```?? Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Damian666:> so its not even stopping on a breakpoint of the> > ```> HandleDataSub(CSendCreateGuild) = GetAddress(AddressOf HandleCreateGuild)> > ```> > ??Yes, when I start server, then its loading them ;) Link to comment Share on other sites More sharing options...
damian666 Posted June 11, 2011 Share Posted June 11, 2011 thats normal, but i mean on client send? Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Damian666:> thats normal, but i mean on client send?On client side I have this code on Create Guild button :```Private Sub cmdCreate_Click() Dim n As Long Dim Buffer As clsBuffer Dim tmpGuildName As String Set Buffer = New clsBuffer Buffer.WriteLong CSendCreateGuild tmpGuildName = Me.txtGuildName.text Buffer.WriteString tmpGuildName SendData Buffer.ToArray() Set Buffer = Nothing Me.HideEnd Sub``` Link to comment Share on other sites More sharing options...
damian666 Posted June 11, 2011 Share Posted June 11, 2011 nonono xdi mean, when ya press the button clientside, so it sends, does it stop in server when ya put a breakpoint on:HandleDataSub(CSendCreateGuild) = GetAddress(AddressOf HandleCreateGuild)?? Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Damian666:> nonono xd> > i mean, when ya press the button clientside, so it sends, does it stop in server when ya put a breakpoint on:> > HandleDataSub(CSendCreateGuild) = GetAddress(AddressOf HandleCreateGuild)> > ??Nope Link to comment Share on other sites More sharing options...
damian666 Posted June 11, 2011 Share Posted June 11, 2011 good, now we know what happens, it doesnt recieve.which is weird though xdtry copying your server enumeration file to the clients, perhaps its different, its hard to see sometimes. Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Damian666:> good, now we know what happens, it doesnt recieve.> > which is weird though xd> > try copying your server enumeration file to the clients, perhaps its different, its hard to see sometimes.Thanks, Damian, I love you :PIt is working now, I'll give you credits. :cheesy: Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now