From daea50b1df19aea257018e4725463f33ce09b937 Mon Sep 17 00:00:00 2001 From: haller Date: Mon, 2 May 2005 19:04:32 +0000 Subject: Modification de send: passage d'un max de 4 arguments à 6 arguments. --- 2005/i/robert/src/proto/proto.cc | 17 +++++++++++++---- 2005/i/robert/src/proto/proto.hh | 6 +++--- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to '2005') diff --git a/2005/i/robert/src/proto/proto.cc b/2005/i/robert/src/proto/proto.cc index d1ba655..2b8996a 100644 --- a/2005/i/robert/src/proto/proto.cc +++ b/2005/i/robert/src/proto/proto.cc @@ -105,7 +105,7 @@ Proto::send (const Frame & frame, bool reliable) /// 32 bits, majuscule pour signé). void Proto::send (char command, const char *format, int a0, int a1, - int a2, int a3, bool reliable) + int a2, int a3, int a4, int a5, bool reliable) { // Constitution de la frame Proto::Frame frame; @@ -121,19 +121,28 @@ Proto::send (char command, const char *format, int a0, int a1, { newArgFrame(frame, format[2],a2); if (format[3] != '\0') + { newArgFrame(frame, format[3],a3); + if(format[4] != '\0') + { + newArgFrame(frame, format[4],a4); + if(format[5] != '\0') + newArgFrame(frame, format[5],a5); + } + + } } - } } +} send(frame,reliable); } /// permet d'envoyer un packet pas fiable void Proto::sendUnreliable (char command, const char *format, int a0, int a1, - int a2, int a3) + int a2, int a3, int a4, int a5) { - send(command, format, a0, a1, a2, a3, false); + send(command, format, a0, a1, a2, a3, a4, a5, false); } /// Teste si le packet correspond au format et décode les valeurs. Utilise diff --git a/2005/i/robert/src/proto/proto.hh b/2005/i/robert/src/proto/proto.hh index 7ee5390..163c44c 100644 --- a/2005/i/robert/src/proto/proto.hh +++ b/2005/i/robert/src/proto/proto.hh @@ -55,7 +55,7 @@ class Proto : public NonCopyable //Date du dernier envoie int tLastSend_; //Temps entre les ré-émission - static const int timeout_ = 100; + static const int timeout_ = 500; /// Frame en cours de réception Frame currentFrame_; @@ -82,10 +82,10 @@ class Proto : public NonCopyable /// format et le nombre de paramètres ('b' : 8 bits, 'w' : 16 bits, 'd' : /// 32 bits, majuscule pour signé). void send (char command, const char *format = "", int a0 = 0, int a1 = 0, - int a2 = 0, int a3 = 0, bool reliable = true); + int a2 = 0, int a3 = 0, int a4 = 0, int a5 = 0, bool reliable = true); /// permet d'envoyer un packet robert void Proto::sendUnreliable (char command, const char *format, int a0, - int a1, int a2, int a3); + int a1, int a2, int a3, int a4, int a5); //@{ /// Teste si le packet correspond au format et décode les valeurs. Utilise /// le même format que send. -- cgit v1.2.3