summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhaller2005-05-02 19:04:32 +0000
committerhaller2005-05-02 19:04:32 +0000
commitdaea50b1df19aea257018e4725463f33ce09b937 (patch)
tree1f88c197069e8fb22f1bfde145980856a705049b
parent6196925a8925a3c43ed60a0805c0aee450db8640 (diff)
Modification de send: passage d'un max de 4 arguments à 6 arguments.
-rw-r--r--2005/i/robert/src/proto/proto.cc17
-rw-r--r--2005/i/robert/src/proto/proto.hh6
2 files changed, 16 insertions, 7 deletions
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.