Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Serverside Modding => Topic started by: noc on December 06, 2012, 11:13:03 pm
-
Hi everyone,
I try to communicate with a server trinity from the character selection page. For more information, files and designs treatments selection page are located in the folder GlueXML. I tried to include files on the processing of messages in the folder FrameXML but without success.
If someone could help me find a method or trick to communicate from the character selection page, I thank in advance.
PS:
Google translate is my friend.
Bonsoir tout le monde,
Je cherche à communiquer avec un serveur trinity à partir de la page de sélection du personnage. Pour information, les fichiers de créations et de traitements de la page de sélection sont situées dans le dossier GlueXML. J'ai tenté d'y inclure les fichiers relatif au traitement des messages du dossier framexml mais sans succès.
Si quelqu'un pouvait m'aider à trouver une méthode ou une astuce pour communiquer à partir de la page de sélection du personnage, je l'en remercie par avance.
PS:
Google translate est mon ami.
-
The only way I can think of would be to make use of Account Messaging. The only way to communicate with clients before they get in game is through existing packets that contain strings - then you can search for strings and react upon them.
When the AccountMessage header is sent, if it contains a string like "[SMSG]..." then react differently. This can be coded in the Lua GlueXML files. Account messages are checked for on character selection & realm selection, however you can rewrite the code so that the functions are called at a different point or do not show until a certain point if they contain a certain string.
More information about account messages can be found here: viewtopic.php?f=12&t=2058 (http://modcraft.io/viewtopic.php?f=12&t=2058" onclick="window.open(this.href);return false;)
-
Thank you for your reply, I'll watch it.
Merci pour votre reponse, je vais regarder ça.
-
(http://i43.servimg.com/u/f43/11/23/84/63/clavie10.jpg)
I made this addon which allows securiser a little access to your server, it communicates with the server responds with SendChatMessage him on the same principle. But I can not find the same kind of communication on the character selection page. If someone could get an idea on the subject to guide me.
J'ai fait cet addon qui permet de securiser un peu l'acces au serveur, il communique avec le serveur avec SendChatMessage qui lui repond sur le meme principe. Mais je n'arrive pas à trouver le même genre de communication sur la page de selection du personnage. Si quelqu'un pouvait avoir une idée sur le sujet pour m'orienter .
-
Sorry but :
"Your account does not have permission to post links ..."
also ... no images ...
You know what? I'm a bad boy ... niak niak niak ...
sinon c'est chez...3W.servimg point com/image_preview.php?i=147&u=11238463 si le coeur vous en dit.
I made this addon which allows securiser a little access to your server, it communicates with the server responds with SendChatMessage him on the same principle. But I can not find the same kind of communication on the character selection page. If someone could get an idea on the subject to guide me.
J'ai fait cet addon qui permet de securiser un peu l'acces au serveur, il communique avec le serveur avec SendChatMessage qui lui repond sur le meme principe. Mais je n'arrive pas à trouver le même genre de communication sur la page de selection du personnage. Si quelqu'un pouvait avoir une idée sur le sujet pour m'orienter .
Yes, once in game you can use SendChatMessage but hide these from the players if they contain a certain string. You are changing how you react depending on which string was retrieved.
The same applies outside of game - you need to find a string that is sent to the server and to the client. The server sends account messages to the player, and the player sends strings to the server (character name, etc).
-
Thank you for your answers.
Yes, I understand the principle. From the login page, but also with the character selection page there are exchanges between the client and the server. But I failed to understand how the client sending the information to the server.
Merci pour vos réponses.
Oui, j'ai bien compris le principe. A partir de la page de login mais aussi avec la page de selection du personnage il y a des échanges entre le client et le serveur. Mais je n'ai pas réussi à comprendre comment le client envoi ces informations au serveur.
-
Thank you for your answers.
Yes, I understand the principle. From the login page, but also with the character selection page there are exchanges between the client and the server. But I failed to understand how the client sending the information to the server.
Merci pour vos réponses.
Oui, j'ai bien compris le principe. A partir de la page de login mais aussi avec la page de selection du personnage il y a des échanges entre le client et le serveur. Mais je n'ai pas réussi à comprendre comment le client envoi ces informations au serveur.
When you create a character, "CreateCharacter(CharacterCreateNameEdit:GetText());" is called.
You could call something like this:
CreateCharacter("SERVERMESSAGEdataONE");
So you are parsing your own string. You can then flag a global variable.
The server will receive the packet for this name, and return whether it is a valid character name or not. You modify it to return invalid character name when it receives this string, but also do whatever you wanted to do when you get that message from the client.
To stop the client showing the "Invalid Character Name" error message, check if the global variable is flagged when the error message is about to be displayed. If it is, do not show the error message and unflag the variable. This is handled in the GlueParent.lua (I think!).
This is just an example, there might be another place where it sends strings. :)
-
A thousand thank you for this information. I will follow your instructions and work on CreateCharacter. Next episode ...
Mille merci pour ces informations. Je vais suivre vos indications et travailler sur le CreateCharacter. Suite au prochain épisode ...
-
Hi,
Here are some news about the function CreateCharacter.
I changed the routine to intercept ObjectMgr :: CheckPlayerName name and retrieve the message. I then changed the file CharacterSelect but nothing works. Either the client crach when I validate my addon or the server receives the message after validation of the choice of character. It seems to me that the client processes the data itself I want because it prevents me transmètre special characters, names too long ... unless I have not picked the right server routines. The next episode ...
PS:
Google translate is my friend.
Bonsoir,
Voici quelques nouvelles concernant la fonction CreateCharacter.
J'ai modifié la routine ObjectMgr::CheckPlayerName pour intercepter le nom et en extraire le message. J'ai ensuite modifié le fichier CharacterSelect mais rien ne fonctionne. Soit le client crach quand je valide mon addon, soit le serveur recoit le message après la validation du choix du personnage. Il me semble que le client traite lui-même les données que je souhaite transmètre car il m'interdit les caractères spéciaux, les noms trop long ... à moins que je n'ai pas intercepté les bonnes routines du serveur. La suite au prochain épisode ...
-
Hi,
Here are some news about the function CreateCharacter.
I changed the routine to intercept ObjectMgr :: CheckPlayerName name and retrieve the message. I then changed the file CharacterSelect but nothing works. Either the client crach when I validate my addon or the server receives the message after validation of the choice of character. It seems to me that the client processes the data itself I want because it prevents me transmètre special characters, names too long ... unless I have not picked the right server routines. The next episode ...
PS:
Google translate is my friend.
Bonsoir,
Voici quelques nouvelles concernant la fonction CreateCharacter.
J'ai modifié la routine ObjectMgr::CheckPlayerName pour intercepter le nom et en extraire le message. J'ai ensuite modifié le fichier CharacterSelect mais rien ne fonctionne. Soit le client crach quand je valide mon addon, soit le serveur recoit le message après la validation du choix du personnage. Il me semble que le client traite lui-même les données que je souhaite transmètre car il m'interdit les caractères spéciaux, les noms trop long ... à moins que je n'ai pas intercepté les bonnes routines du serveur. La suite au prochain épisode ...
If you can get it to a valid name, then the client will attempt to send it.
Only the server knows whether a character name has already been taken or not. This is where you can intercept it.
Hope this is helpful
-
Thank you very much, I'm working on it already ... I try to identify all the routines that test the string name to understand what the server and the client.
PS:
Google translate is my friend.
Merci beaucoup, je travail déjà dessus ... J'essais d'identifier toutes les routines qui testent la chaine du nom pour comprendre ce que fait le serveur et le client.
-
Hi everyone,
I do not know if it's me but it is not the trinity server which controls the validity of the names. All the landmarks that I placed no one answered when I tested validity. The only answer I had were given to me were after the client validation. Despite this, I still got to send information to the server crash without the client or server. Apart from the fact that the message must not exceed 12 characters or contain special characters and I have to adjust some details, I will say that the project is progressing slowly but it advance.
The next episode ...
PS:
Google translate is my friend.
Bonsoir tout le monde,
Je ne sais pas si c'est moi mais ce n'est pas le serveur trinity qui controle la validité des noms. De tout les repères que j'ai placé aucun n'a répondu lors de mes testes de validité. Les seules réponse que j'ai eu m'ont été données l'ont été aprés la validation du client. Malgré cela, je suis quand même arrivé à envoyer une information au serveur sans crash du client ou du serveur. A part le fait que le message ne doit pas dépasser 12 caractères ni contenir de caractères spéciaux et que je doive régler quelques détails, je dirai que le projet avance doucement mais il avance.
La suite au prochain épisode ...
-
uint8 ObjectMgr::CheckPlayerName(const std::string& name, bool create)
{
std::wstring wname;
if (!Utf8toWStr(name, wname))
return CHAR_NAME_INVALID_CHARACTER;
if (wname.size() > MAX_PLAYER_NAME)
return CHAR_NAME_TOO_LONG;
uint32 minName = sWorld->getIntConfig(CONFIG_MIN_PLAYER_NAME);
if (wname.size() < minName)
return CHAR_NAME_TOO_SHORT;
uint32 strictMask = sWorld->getIntConfig(CONFIG_STRICT_PLAYER_NAMES);
if (!isValidString(wname, strictMask, false, create))
return CHAR_NAME_MIXED_LANGUAGES;
wstrToLower(wname);
for (size_t i = 2; i < wname.size(); ++i)
if (wname[i] == wname[i-1] && wname[i] == wname[i-2])
return CHAR_NAME_THREE_CONSECUTIVE;
return CHAR_NAME_SUCCESS;
}
Found here: https://github.com/TrinityCore/TrinityC ... ectMgr.cpp (https://github.com/TrinityCore/TrinityCore/blob/master/src/server/game/Globals/ObjectMgr.cpp" onclick="window.open(this.href);return false;)
-
Yes I know the routine. I've placed this in the first statement:
SLOG-> outString ("Texte du GluXML 1 ->% s <-" name.c_str ());
But during character creation, by voluntarily errors, nothing happens.
Parcontre, after customer acceptance, the server becomes talkative.
This is why I have concluded that managing customer errors character creation.
PS:
Google translate is my friend.
Oui je connais la routine. J'y ai placé ceci en première instruction :
sLog->outString("Texte du GluXML 1 ->%s<-",name.c_str());
Mais pendant la création du personnage, en faisant volontairement des erreurs, rien ne se passe.
Parcontre, aprés acceptation du client, le serveur devient bavard.
C'est pour cela que j'en ai conclut que le client gérait les erreurs de la création du personnage.
-
Hmmm.
If your still struggling at the weekend I'll experiment with this myself. Won't have any free time until Sunday. Good luck. :)
-
Stoneharry: The client does some kind of validation itself. The same as for guild bank tabs, arena team, guilds and pet names.
Your string needs to pass SUniConvertUTF8to16 (converting between UTF8 and Unicode-16).
You should set the cvar forceEnglishNames to false, at least temporary.
Names are validated with charsetMask = -1, thus each character needs to fulfill either IsAlphaLatin1, IsAlphaEnglish, IsAlphaRussian, IsAlphaKorean or IsAlphaChinese.
You need to not match any of reservedNameTokens, chatProfanityTokens or profanityTokens, which are defined in a DBC, thus can just be all removed.
To my information, you can send up to 0x2F bytes of information. You could also send up to 0x3A bytes by setting stuff like selectedClassID.
You could also add additional info by choosing CGlueMgr::RaceChange, ::FactionChange, ::CustomizeCharacter or ::CreateCharacter, adding another two bit (four values).
In the end, just send alpha characters only, while taking advantage of sending Unicode alpha characters as well.
-
Thank you for all this information. I still have a few issues regarding this understanding to translation and technical side of things but overall it's okay.
When I use CreateCharacter a warning window appears which makes its use a bit tricky because you have to validate every time. I'll try to neutralize the famous window that seems difficult but not impossible.
Stoneharry:
Before CreateCharacter execute () must initialize the data on a new character by ResetCharCustomize () otherwise the crash.
PS:
Google translate is my friend.
Merci pour toutes ces indications. J'ai malgré tout quelques difficultées de compréhension dû à la traduction et au coté technique de la chose mais dans l'ensemble ça va.
Lorsque j'utilise CreateCharacter une fenêtre d'avertissement apparait ce qui rend son utilisation un peu délicate car il faut la valider à chaque fois. Je vais donc essayer de neutraliser cette fameuse fenêtre ce qui me parait difficile mais pas impossible.
Stoneharry:
Avant d'executer CreateCharacter() il faut initialiser les données relative à un nouveau personnage par ResetCharCustomize() sinon c'est le crash.
-
Post edited ... New picture. (http://modcraft.io/viewtopic.php?p=19611#p19611)
-
When I use CreateCharacter a warning window appears which makes its use a bit tricky because you have to validate every time. I'll try to neutralize the famous window that seems difficult but not impossible.
PS:
Google translate is my friend.
Lorsque j'utilise CreateCharacter une fenêtre d'avertissement apparait ce qui rend son utilisation un peu délicate car il faut la valider à chaque fois. Je vais donc essayer de neutraliser cette fameuse fenêtre ce qui me parait difficile mais pas impossible.
Yeah, well, I'm definitely an idiot ... as you see ... this famous window is simply the client waits for the response from the server during the creation of the personage, snif, sorry, snif ... I will never again ... until next time.
It remains only to send him a positive response to see more ... the next episode.
PS:
Google translate is my friend.
Oui, et bien, je suis définitivement idiot ... car voyez vous ... cette fameuse fenêtre c'est tout simplement le client qui attend la réponse du serveur lors de la creation du personage, snif, désolé, snif ... je ne recommencerai plus ... jusqu'à la prochaine fois.
Il ne reste plus qu'à lui renvoyer une reponse positive pour voir la suite ... au prochain épisode.
-
Good news, server-side reception works, the answer too. Client side, sending works, the window is "neutralized."
Remains to be seen: Sending information to the client. Next episode ...
PS:
Google translate is my friend.
Bonnes nouvelles, coté serveur la reception fonctionne, la réponse aussi. Coté client, l'envoi fonctionne, la fenêtre est "neutralisée".
Reste à voir : Envoi d'informations vers le client. Suite au prochain épisode ...
-
Hi,
For my project, I have not find another solution for sending information to add a fictional character whose name serves me a message. Remains off the list because there is no place.
I would have preferred to use GetRealmInfo but I do not know ... after take
If someone has another idea I'm interested.
PS:
Google translate is my friend.
Bonsoir,
Pour mon projet, je n'ai pas trouvé d'autre solution pour envoyer des informations que de rajouter un personnage fictif dont le nom me sert de message. Reste à l'enlever de la liste car il n'y a pas sa place.
J'aurai préféré utiliser le GetRealmInfo mais je ne sais pas par bout le prendre ...
Si quelqu'un a une autre idée je suis preneur.
-
Good evening everyone, two new small way. The first is that it is long, very very long unfortunately. I have not been able to understand how the server sends the client realmlist. The second is that you can send to the client names a length greater than 12 characters.
PS:
Google translate is my friend.
Bonsoir tout le monde, deux petites nouvelles en passant. La première c'est que c'est long, trés trés long hélas. Je n'ai pas réussi à comprendre comment le serveur envoie la realmlist au client. La deuxième c'est que l'on peut envoyer au client des noms d'une longueur supèrieur à 12 caractères.
-
Hello everyone, I'm a little busy right now, so I will take the matter a little later by a week, two at most.
PS:
Google translate is my friend.
Bonsoir tout le monde, je suis un peu occupé en ce moment, aussi je reprendrai le sujet un peu plus tard d'ici une semaine, deux au plus.
-
noc how do you make the security question in screen?
-
On the security one: Why not use the matrix from Blizzard?
-
On the security one: Why not use the matrix from Blizzard?
Context: https://www.youtube.com/watch?v=njsuvdLYy1k (https://www.youtube.com/watch?v=njsuvdLYy1k" onclick="window.open(this.href);return false;)
-
noc how do you make the security question in screen?
(http://i43.servimg.com/u/f43/11/23/84/63/clavie10.jpg)
As you can see, there's no secret question.
When the player registers, he gave his login, password and a code of between 4 and 6 figures will be asked by the server. Logged after the server sends a series of values corresponding to the keys of a keyboard, obviously random values, then just copy the code after confirmation will be sent to the server that will control ...
It is a bit like a authentificator fixed value, but who knows if ...
PS:
Google translate is my friend.
Comme vous pouvez le voir, il n'y a pas de question secrete.
Lorsque le joueur s'inscrit, il donne son login, son mot de passe et un code compris entre 4 et 6 chiffres qui lui sera demandé par le serveur. Après s'être logué le serveur envoie une serie de valeurs correspondant aux touches d'un clavier, valeurs aléatoires evidemment, ensuite il suffit de reproduire le code qui après validation sera envoyé au serveur qui le controlera ...
C'est un peu comme un authentificator à valeur fixe, mais qui sait si ...
On the security one: Why not use the matrix from Blizzard?
Because it already exists, and it does not match what I want to do, quite simply.
PS:
Google translate is my friend.
Parce que cela existe déjà, et que cela ne correspond pas à ce que je cherche à faire, tout simplement.
-
Good day to you all, a few new way.
The track realmlist seems to be a good solution for now. I could divert AuthSocket.cpp two routines for sending the message, but the client hangs when loading the list of characters. The routine seems to work but the client crashes, I probably lack of information ... case to be continued.
PS:
Google translate is my friend.
Bien le bonjour à toutes et à tous, quelques petites nouvelles en passant.
La piste du realmlist semble etre la bonne solution pour l'instant. J'ai pu détourner deux routines du AuthSocket.cpp pour l'envoie du message mais le client se bloque au chargement de la liste des personnages. La routine semble fonctionner mais le client se bloque, il me manque sans doute des informations ... affaire à suivre donc.
-
Good day to you all, a few new way.
The track realmlist seems to be a good solution for now. I could divert AuthSocket.cpp two routines for sending the message, but the client hangs when loading the list of characters. The routine seems to work but the client crashes, I probably lack of information ... case to be continued.
PS:
Google translate is my friend.
Bien le bonjour à toutes et à tous, quelques petites nouvelles en passant.
La piste du realmlist semble etre la bonne solution pour l'instant. J'ai pu détourner deux routines du AuthSocket.cpp pour l'envoie du message mais le client se bloque au chargement de la liste des personnages. La routine semble fonctionner mais le client se bloque, il me manque sans doute des informations ... affaire à suivre donc.
You can communicate on the login screen by attempting to login with certain usernames, and the server response is which error code. Hide this from the client.
E.g: http://pastebin.com/Cgdpt8Py (http://pastebin.com/Cgdpt8Py" onclick="window.open(this.href);return false;)
-
Thank you for this information, superb your code.
I noticed that you can send to the client names longer than expected, the problem is that they appear in the list of characters. For they do not appear in the list, simply intercept, then they should simply remove from the list. Personally I'm looking for something more flexible because if I can find I could send information or other guild.
PS:
Google translate is my friend.
Merci pour ces informations, superbe votre code.
J'avais remarqué que l'on pouvez envoyer au client des noms plus long que prévu, le problème c'est qu'ils apparaissent dans la liste des personnages. Pour qu'ils n'apparaissent pas dans la liste, il suffit de les intercepter, ensuite il faut les suprimer de la liste. Personnellement je recherche quelque chose de plus souple car si j'arrive à trouver je pourrais envoyer des informations de guilde ou autres.
-
Hello everyone, it is possible to send messages by the AuthSocket :: _HandleRealmList () and intercept by the lua but it does not correspond to my needs. I'll have to return to the CharacterHandler.cpp for the future and try to delete a character that does not exist ...
PS:
Google translate is my friend.
Bonjour tout le monde, il est donc possible d'envoyer des messages par le AuthSocket::_HandleRealmList() et de les intercepter par le lua mais cela ne correspond pas à mes besoins. Je vais devoir retourner dans le CharacterHandler.cpp pour la suite et essayer d'effacer un personnage qui n'existe pas ...
-
Hello everyone, the project is progressing in small steps but advance.
I can now delete my fictional character, is to correct some details. How we do when there are already 10 characters?
PS:
Google translate is my friend.
Bonjour tout le monde, le projet avance à petits pas mais il avance.
J'arrive maintenant à effacer mon personnage fictif, reste à corriger quelques détails. On fait comment quand il y a déjà 10 personnages?
-
I guess, you can send the request anyway. Is it really blocked by the client?
-
If I understand correctly, the client side, you can send a message to a character in the game by using its guid as a mailing address if not the message can not reach. Server side, except in the realm can send messages via chat procedures.
In character selection page, there is no character to choose and therefore no guid, there is just a guid used for the account.
I do not think it was intended client side to receive a chat message in the character selection page because it will not for a particular purpose.
But sure I can be wrong.
PS:
Google translate is my friend.
Si j'ai bien compris, coté client, on ne peut envoyer de message qu'à un personnage dans le jeu en se servant de son guid comme d'une adresse postale sinon le message ne peut pas aboutir. Coté serveur, hormis dans le realm on peut envoyer des messages par les procédures de chat.
Dans la page de selection des personnages, il n'y a aucun personnage de selectioner et donc pas de guid, il y a juste un guid servant pour le compte.
Je ne pense pas qu'il ait été prévu coté client de recevoir un message de chat dans la page de selection des personnages car cela n'aurai pas d'utilité particulière.
Mais bien sure je peut me tromper.
-
Hello everyone, after having solved a lot of small problems, I consider this part to be completed. Currently the server sends information to the client recovers, analysis and used as a key. The player includes code validation and after the client back to the server for analysis. Then the server responds favorably or not. After five unsuccessful attempts the client closes.
It remains for me to do some cleaning in the code to save the validation code in the db and I can move on.
PS:
Google translate is my friend.
Bonjour tout le monde, après avoir résolu pas mal de petits problèmes, je considère cette partie comme terminée. A l'heure actuelle le serveur envoie une information au client qui la récupère, l'analyse et l'utilise comme une clé. Le joueur compose son code et après validation le client la renvoie au serveur pour analyse. Ensuite le serveur répond favorablement ou pas. Après cinq essais infructueux le client se ferme.
Il ne me reste plus qu'a faire un peu de ménage dans le code, à enregistrer le code de validation dans la db et je pourrai passer à la suite.
-
Congratulations. :)
-
Merci beaucoup stoneharry.
-
Good day good people, putting some order in the lua code changes, I finally found what I was wanting to ask the server to update the list of characters instead of deleting them. This allows me to send a list of all information and then reapply the server the list of characters. In the server, simply place a flag that determines whether the information has been sent. This makes the code much simpler and avoids having to ask the server to delete one by one fictional characters supporting information.
PS:
Google translate is my friend.
Bien le bonjour brave gens, en mettant un peu d'ordre dans les modifications du code lua, j'ai fini par trouver ce qu'il me manquait pour demander au serveur de réactualiser la liste des personnages au lieu de les effacer. Ce qui me permet d'envoyer tout une liste d'informations et ensuite de redemander au serveur la liste des personnages. Dans le serveur, il suffit de placer un drapeau qui détermine si les informations ont été envoyées. Cela rend le code beaucoup plus simple et évite d'avoir à demander au serveur d'effacer un par un les personnages fictifs porteur des informations.
-
Mind sharing the code? For science and optimization?
-
Yes, but not almost. I would not do a tutorial for that because I happened to find on the net with the only modification the creator ... So without comment (http://forum.model-changing.com/thread-1155-post-11782.html#pid11782).
But since you helped me to better understand and guide my research, I will explain the principle of the forum, and for those who participated actively in MP if necessary.
In this way I share my general knowledge about the problem with the forum and the finer points with those who were willing to help me by participating in the discution in the discution actively..
PS:
Google translate is my friend.
Oui mais non, enfin presque. Je ne ferais pas de tutoriel pour ça car il m'est arrivé d'en retrouver sur le net avec comme seule modification le nom du créateur ... sans commentaire donc (http://forum.model-changing.com/thread-1155-post-11782.html#pid11782).
Mais vu que vous m'avez aidé à mieux comprendre et orienter mes recherches, je vous en expliquerai le principe sur le forum, et pour ceux qui ont participés de façon active par MP si nécéssaire.
De cette façon je partagerai mes connaissances générales sur le problème avec le forum et les points plus délicats avec ceux qui ont bien voulu m'aider en participant à la discution de façon active.
-
Le niveau demandé est assez élevé alors lisez, lisez ...
Je n'aiderai pas plus que ça alors à vous de lire et de comprendre car j'y ai passé plus de six mois dessus pour comprendre le principe et l'experimenter afin d'obtenir un résultat trés interressant ... à vous de jouer maintenant.
Un grand merci à Alborq pour son aide ainsi qu'à stoneharry et schlumpf pour leurs participations.
The requested level is high enough then read, read ...
I do not help you more than that then you read and understand because I spent more than six months to understand the above principle and experiment to obtain a result very interresting ... your turn now.
A big thank you for helping to Alborq stoneharry as well as for their participation and schlumpf.
Well, here is an explanation of principle, I say.
MY initial idea:
Ask the player once logger, kindly enter the code hautentification.
The problem:
Client side, there is no messaging possible on the selection page of the characters, not sending or reception of message.
Server side, no particular problem since I work on the source.
Solutions:
The client sends and receives information such as the server, for short; during character creation ...
problems:
There is a control over the name that is made by the customer during the character creation so it must remain standard but not the reception of the name.
Solution principle :
To send a message to the server, lua, I request the creation of a fictional character whose name contains my message.
To receive a message, the server sends a fictitious name with the message.
Some restrictions, however, messages must be received at the beginning of the creation of the character selection page, in my case this is quite what I'm looking, it will also delete these characters because they are fictitious and their name does not match nothing for the player.
No more than ten names if the customer does its job of blocking ...
For sending messages on the client side must remain standard if the client ...
As I try to send or receive MY message, I should be able to differentiate it from others, that I decided to use a header such as client side:
To send "MSG" header beginning and "W" end of message
In reception: "MSG_"
PS:
Google translate is my friend.
Bien, voici donc une explication de principe je dirai.
MON idée de départ :
Demander au joueur, une fois logger, de bien vouloir entrer un code d'hautentification.
Le problème :
Coté client, il n'y a pas de messagerie possible sur la page de selection des personnages, donc pas d'envoi ni de reception de message.
Coté serveur, pas de problème particulier puisque je travail sur le source.
Les solutions :
Le client envoie et reçoit des informations au serveur comme par exemple; pour faire plus court; lors de la création de personnages ...
Problèmes :
Il y a un controle sur le nom qui est fait par le client lors de la création du personnage donc il faut rester standard mais pas sur la reception du nom.
Solution de principe :
Pour envoyer un message au serveur, en lua, je demande la création d'un personnage fictif dont le nom contient mon message.
Pour recevoir un message, le serveur envoi un nom fictif contenant le message.
Quelques restrictions cependant, les messages doivent parvenir au début de la création de la page de selection des personnages, dans mon cas cela correspond tout à fait à ce que je recherche, il faudra aussi effacer ces personnages car ils sont fictifs et leur nom ne correspond à rien pour le joueur.
Pas plus de dix noms sinon le client fait son travail de blocage ...
Pour l'envoi de messages coté client il faut rester standard sinon le client ...
Comme je cherche à envoyer ou à recevoir MON message, je dois pouvoir le différencier des autres, pour cela je décide d'utiliser une entète comme par exemple coté client :
Pour l'envoie : "MSG" en entète de début et "W" en fin de message
En reception : "MSG_"
-
edit du post. (http://modcraft.io/viewtopic.php?p=22134#p22134)
-
I'm a little busy right now, but I think of you.
Je suis un peu occupé en ce moment, mais je pense à vous.
-
Thanks for sharing the full process of how you achieved what you have implemented. ;)
-
edit du post. (http://modcraft.io/viewtopic.php?p=22135#p22135)
-
Dernière édition du post. (http://modcraft.io/viewtopic.php?p=22137#p22137)
-
Please prefer posting a new post containing content, rather than editing a post and adding a new post telling you updated the old one. It is harder to understand what changed, this way. Especially for people only checking the latest new posts. E.g. I won't go back to the edited post right now, just because of laziness to even search it.
Copying the edited content to the past post is superior to notifying about the update. Just a plain copy will do it already!
-
I'll start by sending a message to the server, it is easier. For that you have to work in and use CharacterSelect.lua example CreateCharacter ("MSGhimodcraftW").
In the server, I'll intercept in ObjectMgr.cpp: CheckPlayerName () testing in the presence of the name "MSG" to start and "W" at the end. If this is the case I code returns a positive but a negative one another the code.
The following happens in CharacterHandler.cpp: HandleCharCreateOpcode () where I will discuss the name as follows:
After CheckPlayerName (), I test MY reponse, if it is positive I send data << uint8 (CHAR_CREATE_SUCCESS), otherwise data << uint8 (CHAR_NAME_TOO_LONG).
Now I have to get the error code in the client CHAR_NAME_TOO_LONG ... it's easy you see.
PS:
Google translate is my friend.
Je vais commencer par envoyer un message au serveur, c'est plus facile. Pour ça il faut travailler dans CharacterSelect.lua et utiliser par example CreateCharacter("MSGmodcraftW").
Dans le serveur, je vais l'intercepter dans ObjectMgr.cpp:CheckPlayerName() en testant dans le nom la présence de "MSG" au début et de "W" à la fin. Si c'est le cas je retourne un code positif sinon un autre code négatif celui-la.
La suite se passe dans CharacterHandler.cpp:HandleCharCreateOpcode() où je vais traiter le nom comme suit :
Après le CheckPlayerName(), je teste MA réponse, si elle est positive j'envoie data << uint8(CHAR_CREATE_SUCCESS); sinon data << uint8(CHAR_NAME_TOO_LONG); .
Maintenant je dois récupérer le code d'erreur CHAR_NAME_TOO_LONG dans le client ... c'est facile vous allez voir.
-
To catch errors or rather the error CHAR_NAME_TOO_LONG must change GlueDialog.lua and more specifically GlueDialog_Show. To make the difference between MY error message and the system, we just consider the fact that it is because of the message it sends MY something will happen before then I send will activate a flag to signal this sends and immediately after I deactivated. This flag is a Boolean variable whose declaration should not be local.
For GlueDialog_Show, check that the flag is active and the Which contains many "INVALID_NAME", if this is the case it is MY mistake. I can not forget a StatusDialogClick () and a little return out of there.
Now it is the turn of GlueDialogTypes ["INVALID_NAME"] because it displays the error message.
In OnShow I check my flag, if it is active then I close by GlueDialog: Hide ();
What is good with GlueDialog is that you can create your own error message ... or others.
Voila, now when the server responds to the creation of a fictional character, I can catch the error code that I set. Despite the limited number of characters, nothing prevents me to send a message to the server.
It only remains for me to send a message to the client, which does not seem to be a more difficult problem than that.
PS:
Google translate is my friend.
Pour pouvoir intercepter les erreurs ou plutot l'erreur CHAR_NAME_TOO_LONG, il faut modifier GlueDialog.lua et plus précisément GlueDialog_Show. Pour pouvoir faire la différence entre MON message d'erreur et celui du système, il faut juste considérer le fait que c'est à cause de l'envoie de MON message qu'il va se passer quelque chose alors avant de l'envoyer je vais activer un drapeau pour signaler cet envoie et immediatement après je le desactive. Ce drapeau ne sera qu'une variable booléenne dont la déclaration ne devra pas être local.
Pour le GlueDialog_Show, il faut vérifier que le drapeau est actif et que le which contienne bien "INVALID_NAME", si c'est le cas c'est bien MON erreur. Je n'oublie pas un StatusDialogClick(); et un petit return pour sortir de là.
Maintenant c'est au tour de GlueDialogTypes["INVALID_NAME"] car il affiche le message d'erreur.
Dans son OnShow je verifie mon drapeau, s'il est actif alors je ferme par GlueDialog:Hide();
Ce qu'il y a de bien avec le GlueDialog, c'est que l'on peut créer son propre message d'erreur ... ou autres.
Voila, maintenant lorsque le serveur répond à la création d'un personnage fictif, je peux intercepter le code d'erreur que j'ai fixé. Malgré la limitation du nombre de caractères, rien de m'empèche d'envoyer un message au serveur.
Il ne me reste plus qu'à envoyer un message au client, ce qui ne semble pas être un problème plus difficile que ça.
-
I'm lucky for once, the client does not control the length of the name so as to enjoy a little.
As I need to know if it is a message rather than a character I put a header like "MSG_" then my message and send my message I look into CharacterHandler.cpp: HandleCharEnum, this routine sends the list of characters of the player.
Since each call to this routine sends the list of characters that could pose a few problems because if I send my messages to deserts, they will be sent to each call. To remedy this concern I use a flag. If it's negative I send my messages and I active if I send the list of characters. To send a message I need structure character I'll get in Player.cpp: BuildEnumData. I'll copy routine, paste, change its name and allow the arrival of the message. Once done I'll fill in the variables "by hand" with the data of a character who is in the db and overcharged as to write his name I place my message.
Here is a great thing done. With that my messages have a body and can be send.
PS:
Google translate is my friend.
J'ai de la chance pour une fois, le client ne controle pas la longueur du nom alors autant en profiter un peu.
Comme j'ai besoin de savoir si c'est un message plutot qu'un personnage je mets une entete du genre "MSG_" puis mon message et pour envoyer mon message je regarde dans CharacterHandler.cpp:HandleCharEnum, cette routine permet d'envoyer la liste des personnages du joueur.
Comme chaque appel à cette routine envoie la liste des personnages cela risque de poser quelques petits soucis car si je m'en serts pour envoyer mes messages, ils seront envoyés à chaque appel. Pour remedier à ce soucis j'utilise un drapeau. S'il est négatif j'envoie mes messages et je l'active sinon j'envoie la liste des personnages. Pour envoyer un message j'ai besoin d'une structure de personnage que je vais aller chercher dans Player.cpp:BuildEnumData. Je vais copier la routine, la coller, changer son nom et permettre l'arrivée du message. Une fois fait je vais remplir les variables "à la main" avec les données d'un personnage qui se trouve dans la db et plustot que d'écrire son nom je place mon message.
Voila une bonne chose de faite. Avec ça mes messages ont un corps et peuvent donc être envoyer.
-
Client side in UpdateCharacterList () retrieves I my message with name I test whether my header is present. If this is the case ...
Now the problem is that you delete these fictional characters that serve to bring me messages. To do this, we'll have to do something very complicated : GetCharacterListUpdate ();
After that the server receives the request for the list of characters which will clear the list of fictional characters by replacing it with the real ... if the flag been activated.
The result? well no it's over.
I must admit that this is not an easy but you have everything you need to achieve great things.
Send messages to GMs or warnings unscrupulous players, news, authenticator ...
It's your turn now.
PS:
Google translate is my friend.
Coté client, dans UpdateCharacterList() je recupère mon message avec name que je teste pour savoir si mon entète est présente. Si c'est le cas ...
Maintenant le problème est qu'il faut effacer ces personnages fictifs qui ne me servent qu'à apporter des messages. Pour cela, il va falloir faire un truc très compliqué : GetCharacterListUpdate();
Après ça le serveur recoit la demande de liste de personnages ce qui effacera le liste des personnages fictifs en les remplacant par les vraies ... si le drapeau à bien été activé.
La suite? Bin non c'est fini ...
Je dois bien reconnaitre que cela n'a rien de facile mais vous avez tout ce qu'il faut pour réaliser de grandes choses.
Envoyer des messages aux GMs ou des avertissements aux joueurs indélicats, des news, authentificateur ...
A vous de jouer maintenant.
-
Thank you schlumpf, it's better that way I think.
Merci schlumpf, c'est bien mieux comme ça il me semble.
-
thank you stoneharry yes i am really new to lua moding and i really d not what i am doing but i trying to learn are there any good website where i can learn how to do lua and xml programming ? for free
Looking at the signature: spambot?!
-
thank you stoneharry yes i am really new to lua moding and i really d not what i am doing but i trying to learn are there any good website where i can learn how to do lua and xml programming ? for free
Looking at the signature: spambot?!
Nope, he's been around for a while. I always think the same though, lmao.
-
whaou ... +7000 views.
Too bad there have no more questions. To celebrate this, the 7000 views eh, this is what significantly improve the code but also the desing.
So to take the concept of customer discution / server and vice versa, I opt for a simple but effective principle. Because the server sends an error code when there is a problem why not do the same thing when it are none? So define in the negative an answer server for expressing that everything is good and another negative response to say that there is a problem, for example too of characters ect. In the client, modify the lua in the routine that has been modified to intercept the error message for it to accept others and manage the new answer as it should. this way, no need to create a fictional character that will avoid a lot of problem in case of accidental disconnections.
whaou ... +7000 vues.
Dommage qu'il n'y ai pas plus de question. Pour feter ça, les +7000 vues hein, voici de quoi ameliorer sensiblement le code mais aussi le concepte.
Donc pour reprendre le principe de la discution client/serveur et inversement, j'ai opter pour un principe simple mais efficace. Puisque le serveur envoi un code d'erreur quand il y a un probleme pourquoi ne pas faire la meme chose quand il n'y en a pas? Donc definissez dans le serveur une reponse negative pour exprimer que tout est bon et une autre reponse negative pour dire qu'il y a un probleme, par exemple trop de caracteres ect. Dans le client, modifiez le lua dans la routine qui a été modifiée pour intercepter le message d'erreur pour qu'il en accepte d'autres et gérez la nouvelle reponse comme il se doit. De cette facon, plus besoin de creer un personnage fictif ce qui evitera pas mal de probleme en cas de deconnection intempestive.