mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 01:24:18 +00:00
Merged Oy, Isolated Freeze from Deep Freeze
This commit is contained in:
commit
f83132448d
|
@ -1,4 +1,4 @@
|
|||
|
||||
|
||||
##### translated strings #####
|
||||
|
||||
%d of %d servers, %d players
|
||||
|
@ -570,7 +570,7 @@ CW
|
|||
Cancel
|
||||
==
|
||||
|
||||
Clear collision
|
||||
Clear
|
||||
==
|
||||
|
||||
Clip H
|
||||
|
@ -585,6 +585,9 @@ Clip X
|
|||
Clip Y
|
||||
==
|
||||
|
||||
Collision
|
||||
==
|
||||
|
||||
Color
|
||||
==
|
||||
|
||||
|
@ -597,7 +600,7 @@ Color TO
|
|||
Color+
|
||||
==
|
||||
|
||||
Constructs collision from this layer
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Creates a new color envelope
|
||||
|
@ -615,6 +618,9 @@ Creates a new quad layer
|
|||
Creates a new tile layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
Decrease
|
||||
==
|
||||
|
||||
|
@ -678,6 +684,9 @@ File: %s
|
|||
Filename:
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
Green value of the envelope
|
||||
==
|
||||
|
||||
|
@ -726,9 +735,6 @@ Load a new image to use in the map
|
|||
Load map
|
||||
==
|
||||
|
||||
Make collision
|
||||
==
|
||||
|
||||
Make external
|
||||
==
|
||||
|
||||
|
@ -810,9 +816,6 @@ Refocus
|
|||
Remove
|
||||
==
|
||||
|
||||
Removes collision from this layer
|
||||
==
|
||||
|
||||
Removes the image from the map
|
||||
==
|
||||
|
||||
|
@ -903,6 +906,9 @@ Toggles the envelope editor.
|
|||
Unable to delete the demo
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
Up
|
||||
==
|
||||
|
||||
|
|
|
@ -519,7 +519,7 @@ CW
|
|||
Cancel
|
||||
==
|
||||
|
||||
Clear collision
|
||||
Clear
|
||||
==
|
||||
|
||||
Clip H
|
||||
|
@ -534,6 +534,9 @@ Clip X
|
|||
Clip Y
|
||||
==
|
||||
|
||||
Collision
|
||||
==
|
||||
|
||||
Color
|
||||
==
|
||||
|
||||
|
@ -549,7 +552,7 @@ Color+
|
|||
Connection Problems...
|
||||
==
|
||||
|
||||
Constructs collision from this layer
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Creates a new color envelope
|
||||
|
@ -567,6 +570,9 @@ Creates a new quad layer
|
|||
Creates a new tile layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
Decrease
|
||||
==
|
||||
|
||||
|
@ -645,6 +651,9 @@ Filename:
|
|||
Folder
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
Green value of the envelope
|
||||
==
|
||||
|
||||
|
@ -696,9 +705,6 @@ Load a new image to use in the map
|
|||
Load map
|
||||
==
|
||||
|
||||
Make collision
|
||||
==
|
||||
|
||||
Make external
|
||||
==
|
||||
|
||||
|
@ -798,9 +804,6 @@ Refocus
|
|||
Remove
|
||||
==
|
||||
|
||||
Removes collision from this layer
|
||||
==
|
||||
|
||||
Removes the image from the map
|
||||
==
|
||||
|
||||
|
@ -900,6 +903,9 @@ Toggles the envelope editor.
|
|||
Unable to delete the demo
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
Up
|
||||
==
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
##### translated strings #####
|
||||
|
||||
%d of %d servers, %d players
|
||||
|
@ -21,7 +22,6 @@
|
|||
%i seconds left
|
||||
== nog %i seconden
|
||||
|
||||
|
||||
%s Right click for context menu.
|
||||
== %s Rechtermuisknop voor context menu.
|
||||
|
||||
|
@ -124,9 +124,6 @@ Cancel
|
|||
Chat
|
||||
== Chat
|
||||
|
||||
Clear collision
|
||||
== Verwijder botsingen
|
||||
|
||||
Clip H
|
||||
== Clip H
|
||||
|
||||
|
@ -169,9 +166,6 @@ Connection Problems...
|
|||
Console
|
||||
== Console
|
||||
|
||||
Constructs collision from this layer
|
||||
== Maakt deze laag botsend
|
||||
|
||||
Controls
|
||||
== Besturing
|
||||
|
||||
|
@ -457,9 +451,6 @@ Loading
|
|||
MOTD
|
||||
== MOTD
|
||||
|
||||
Make collision
|
||||
== Maak botsend
|
||||
|
||||
Make external
|
||||
== Maak extern
|
||||
|
||||
|
@ -496,12 +487,12 @@ Mute when not active
|
|||
Name
|
||||
== Naam
|
||||
|
||||
Name:
|
||||
== Naam:
|
||||
|
||||
Name plates size
|
||||
== Grootte naamplaat
|
||||
|
||||
Name:
|
||||
== Naam:
|
||||
|
||||
New
|
||||
== Nieuw
|
||||
|
||||
|
@ -658,9 +649,6 @@ Remote console
|
|||
Remove
|
||||
== Verwijder
|
||||
|
||||
Removes collision from this layer
|
||||
== Verwijdert botsingen in deze laag
|
||||
|
||||
Removes the image from the map
|
||||
== Verwijdert de afbeelding uit de kaart
|
||||
|
||||
|
@ -779,7 +767,7 @@ Sound
|
|||
== Geluid
|
||||
|
||||
Sound error
|
||||
== Geluidsfout
|
||||
== Geluidsfout
|
||||
|
||||
Sound volume
|
||||
== Volume
|
||||
|
@ -972,6 +960,24 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Clear
|
||||
==
|
||||
|
||||
Collision
|
||||
==
|
||||
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
##### DDRace #####
|
||||
|
|
|
@ -543,7 +543,7 @@ CW
|
|||
Cancel
|
||||
==
|
||||
|
||||
Clear collision
|
||||
Clear
|
||||
==
|
||||
|
||||
Clip H
|
||||
|
@ -558,6 +558,9 @@ Clip X
|
|||
Clip Y
|
||||
==
|
||||
|
||||
Collision
|
||||
==
|
||||
|
||||
Color
|
||||
==
|
||||
|
||||
|
@ -570,7 +573,7 @@ Color TO
|
|||
Color+
|
||||
==
|
||||
|
||||
Constructs collision from this layer
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Creates a new color envelope
|
||||
|
@ -588,6 +591,9 @@ Creates a new quad layer
|
|||
Creates a new tile layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
Decrease
|
||||
==
|
||||
|
||||
|
@ -657,6 +663,9 @@ Filename:
|
|||
Folder
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
Green value of the envelope
|
||||
==
|
||||
|
||||
|
@ -708,9 +717,6 @@ Load a new image to use in the map
|
|||
Load map
|
||||
==
|
||||
|
||||
Make collision
|
||||
==
|
||||
|
||||
Make external
|
||||
==
|
||||
|
||||
|
@ -807,9 +813,6 @@ Refocus
|
|||
Remove
|
||||
==
|
||||
|
||||
Removes collision from this layer
|
||||
==
|
||||
|
||||
Removes the image from the map
|
||||
==
|
||||
|
||||
|
@ -903,6 +906,9 @@ Toggles the envelope editor.
|
|||
Unable to delete the demo
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
Up
|
||||
==
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
== %d%% chargé
|
||||
|
||||
%ds left
|
||||
== %ds a quitté
|
||||
== %ds pour voter
|
||||
|
||||
%i minute left
|
||||
== %i minute restante
|
||||
|
@ -22,6 +22,9 @@
|
|||
%i seconds left
|
||||
== %i secondes restantes
|
||||
|
||||
%s Right click for context menu.
|
||||
== %s clique droit pour afficher le menu contextuel
|
||||
|
||||
Abort
|
||||
== Annuler
|
||||
|
||||
|
@ -46,6 +49,9 @@ All
|
|||
Alpha
|
||||
== Alpha
|
||||
|
||||
Alpha value of the envelope
|
||||
== Valeur d'alpha dans l'arriere-plan
|
||||
|
||||
Always show name plates
|
||||
== Toujours afficher les pseudonymes
|
||||
|
||||
|
@ -79,6 +85,9 @@ Blue team
|
|||
Blue team wins!
|
||||
== L'équipe bleue gagne !
|
||||
|
||||
Blue value of the envelope
|
||||
== Valeur de bleu dans l'arriere-plan
|
||||
|
||||
Body
|
||||
== Corps
|
||||
|
||||
|
@ -100,15 +109,18 @@ Cancel
|
|||
Chat
|
||||
== Chat
|
||||
|
||||
Clear collision
|
||||
== Nettoyer la collision
|
||||
|
||||
Close
|
||||
== Fermer
|
||||
|
||||
Color
|
||||
== Couleur
|
||||
|
||||
Color Env
|
||||
== Couleur Env
|
||||
|
||||
Color TO
|
||||
== Couleur TO
|
||||
|
||||
Color+
|
||||
== Couleur+
|
||||
|
||||
|
@ -127,15 +139,18 @@ Connection Problems...
|
|||
Console
|
||||
== Console
|
||||
|
||||
Constructs collision from this layer
|
||||
== Fait la collision depuis cette couche
|
||||
|
||||
Controls
|
||||
== Contrôles
|
||||
|
||||
Creates a new color envelope
|
||||
== Créer une nouvelle couleur d'arriere-plan
|
||||
|
||||
Creates a new map
|
||||
== Crée une nouvelle carte
|
||||
|
||||
Creates a new pos envelope
|
||||
== Créer un nouvel arriere-plan
|
||||
|
||||
Current
|
||||
== Actuellement
|
||||
|
||||
|
@ -163,6 +178,9 @@ Delete group
|
|||
Delete layer
|
||||
== Supprimer la couche
|
||||
|
||||
Delete this envelope
|
||||
== Supprimer l'arriere-plan
|
||||
|
||||
Deletes the layer
|
||||
== Supprime la couche
|
||||
|
||||
|
@ -208,6 +226,9 @@ Emoticon
|
|||
Enter
|
||||
== Démarrer
|
||||
|
||||
Envelopes
|
||||
== Arriere-plans
|
||||
|
||||
Error
|
||||
== Erreur
|
||||
|
||||
|
@ -280,6 +301,9 @@ General
|
|||
Graphics
|
||||
== Affichage
|
||||
|
||||
Green value of the envelope
|
||||
== Valeur de vert dans l'arriere-plan
|
||||
|
||||
Grenade
|
||||
== Lance-grenade
|
||||
|
||||
|
@ -355,6 +379,12 @@ Layers
|
|||
Left
|
||||
== Gauche
|
||||
|
||||
Left mouse button to move. Hold shift to move pivot. Hold ctrl to rotate.
|
||||
== Boutton gauche de la souris pour bouger. Maintenez [shift] pour changer le pivot. Maintenez [ctrl] pour la rotation.
|
||||
|
||||
Left mouse button to move. Hold shift to move the texture.
|
||||
== Boutton gauche de la souris pour bouger. Maintenez [shift] pour changer la texture.
|
||||
|
||||
Lht.
|
||||
== Lum.
|
||||
|
||||
|
@ -373,9 +403,6 @@ Loading
|
|||
MOTD
|
||||
== MOTD
|
||||
|
||||
Make collision
|
||||
== Faire la collision
|
||||
|
||||
Make external
|
||||
== Mettre en externe
|
||||
|
||||
|
@ -424,6 +451,9 @@ New folder
|
|||
News
|
||||
== Nouvelles
|
||||
|
||||
Next Envelope
|
||||
== L'arriere-plan suivant
|
||||
|
||||
Next weapon
|
||||
== Arme suivante
|
||||
|
||||
|
@ -490,6 +520,12 @@ Players
|
|||
Please balance teams!
|
||||
== Équilibrez les équipes !
|
||||
|
||||
Pos X
|
||||
== position X
|
||||
|
||||
Pos Y
|
||||
== position Y
|
||||
|
||||
Pos.+
|
||||
== Pos.+
|
||||
|
||||
|
@ -499,6 +535,9 @@ Press right mouse button to create a new point
|
|||
Prev. weapon
|
||||
== Arme précédente
|
||||
|
||||
Previous Envelope
|
||||
== L'arriere-plan précédent
|
||||
|
||||
Quality Textures
|
||||
== Textures haute qualité
|
||||
|
||||
|
@ -514,12 +553,18 @@ REC
|
|||
Reason:
|
||||
== Raison :
|
||||
|
||||
Record demo
|
||||
== Enregistrement démo
|
||||
|
||||
Red team
|
||||
== Équipe rouge
|
||||
|
||||
Red team wins!
|
||||
== L'équipe rouge gagne !
|
||||
|
||||
Red value of the envelope
|
||||
== Valeur de rouge dans l'arriere-plan
|
||||
|
||||
Refresh
|
||||
== Rafraîchir
|
||||
|
||||
|
@ -532,9 +577,6 @@ Remote console
|
|||
Remove
|
||||
== Enlever
|
||||
|
||||
Removes collision from this layer
|
||||
== Enlève la collision depuis cette couche
|
||||
|
||||
Removes the image from the map
|
||||
== Enlève l'image de la carte
|
||||
|
||||
|
@ -562,6 +604,9 @@ Rifle
|
|||
Right
|
||||
== Droite
|
||||
|
||||
Rotation of the envelope
|
||||
== Rotation de l'arriere-plan
|
||||
|
||||
Round
|
||||
== Round
|
||||
|
||||
|
@ -658,6 +703,9 @@ Standard gametype
|
|||
Standard map
|
||||
== Cartes standards
|
||||
|
||||
Stop record
|
||||
== Stopper l'enregistrement
|
||||
|
||||
Sudden Death
|
||||
== Mort Subite
|
||||
|
||||
|
@ -697,6 +745,12 @@ UI Color
|
|||
Up
|
||||
== Haut
|
||||
|
||||
Use left mouse button to drag and change the color value. Hold shift to be more precise.
|
||||
== Maintenez le boutton gauche de la souris et déplacer là pour changer la valeur de la couleur. Maintenez [shift] pour plus de présision
|
||||
|
||||
Use left mouse button to drag and change the value. Hold shift to be more precise.
|
||||
== Maintenez le boutton gauche de la souris et déplacer là pour changer la valeur. Maintenez [shift] pour plus de présision
|
||||
|
||||
Use sounds
|
||||
== Jouer les sons
|
||||
|
||||
|
@ -759,9 +813,6 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
%s Right click for context menu.
|
||||
==
|
||||
|
||||
Add Quad
|
||||
==
|
||||
|
||||
|
@ -774,13 +825,10 @@ Add tile layer
|
|||
Adds a new quad
|
||||
==
|
||||
|
||||
Alpha value of the envelope
|
||||
==
|
||||
|
||||
Aspect ratio
|
||||
==
|
||||
|
||||
Blue value of the envelope
|
||||
Clear
|
||||
==
|
||||
|
||||
Clip H
|
||||
|
@ -795,16 +843,10 @@ Clip X
|
|||
Clip Y
|
||||
==
|
||||
|
||||
Color Env
|
||||
Collision
|
||||
==
|
||||
|
||||
Color TO
|
||||
==
|
||||
|
||||
Creates a new color envelope
|
||||
==
|
||||
|
||||
Creates a new pos envelope
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Creates a new quad layer
|
||||
|
@ -813,7 +855,7 @@ Creates a new quad layer
|
|||
Creates a new tile layer
|
||||
==
|
||||
|
||||
Delete this envelope
|
||||
Death
|
||||
==
|
||||
|
||||
Deletes the current quad
|
||||
|
@ -825,63 +867,36 @@ Enable/disable group for saving
|
|||
Enable/disable layer for saving
|
||||
==
|
||||
|
||||
Envelopes
|
||||
==
|
||||
|
||||
Green value of the envelope
|
||||
Game tiles
|
||||
==
|
||||
|
||||
HD
|
||||
==
|
||||
|
||||
Left mouse button to move. Hold shift to move pivot. Hold ctrl to rotate.
|
||||
==
|
||||
|
||||
Left mouse button to move. Hold shift to move the texture.
|
||||
==
|
||||
|
||||
Left mouse to drag. Hold ctrl to be more precise. Hold shift to alter time point aswell. Right click to delete.
|
||||
==
|
||||
|
||||
Name plates size
|
||||
==
|
||||
|
||||
Next Envelope
|
||||
==
|
||||
|
||||
Para X
|
||||
==
|
||||
|
||||
Para Y
|
||||
==
|
||||
|
||||
Pos X
|
||||
==
|
||||
|
||||
Pos Y
|
||||
==
|
||||
|
||||
Pos. Env
|
||||
==
|
||||
|
||||
Pos. TO
|
||||
==
|
||||
|
||||
Previous Envelope
|
||||
==
|
||||
|
||||
Proof
|
||||
==
|
||||
|
||||
Quads
|
||||
==
|
||||
|
||||
Record demo
|
||||
==
|
||||
|
||||
Red value of the envelope
|
||||
==
|
||||
|
||||
Refocus
|
||||
==
|
||||
|
||||
|
@ -891,9 +906,6 @@ Resizes the current Quad based on the aspect ratio of the image
|
|||
Rotation of the brush in degrees. Use left mouse button to drag and change the value. Hold shift to be more precise.
|
||||
==
|
||||
|
||||
Rotation of the envelope
|
||||
==
|
||||
|
||||
Shift
|
||||
==
|
||||
|
||||
|
@ -903,9 +915,6 @@ Sound error
|
|||
Squares the current quad
|
||||
==
|
||||
|
||||
Stop record
|
||||
==
|
||||
|
||||
Switch between images and layers managment.
|
||||
==
|
||||
|
||||
|
@ -930,15 +939,12 @@ Toggles the envelope editor.
|
|||
Unable to delete the demo
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
Use Clipping
|
||||
==
|
||||
|
||||
Use left mouse button to drag and change the color value. Hold shift to be more precise.
|
||||
==
|
||||
|
||||
Use left mouse button to drag and change the value. Hold shift to be more precise.
|
||||
==
|
||||
|
||||
Use left mouse button to drag and create a brush.
|
||||
==
|
||||
|
||||
|
@ -974,7 +980,6 @@ Y-axis of the envelope
|
|||
|
||||
##### old translations #####
|
||||
|
||||
|
||||
##### DDRace #####
|
||||
|
||||
Loading DDRace Client
|
||||
|
|
|
@ -77,7 +77,7 @@ Append map
|
|||
== Karte anhängen
|
||||
|
||||
Are you sure that you want to delete the demo?
|
||||
== Möchtest du die Demo wirklich löschen?
|
||||
== Möchtest du die Aufnahme wirklich löschen?
|
||||
|
||||
Are you sure that you want to quit?
|
||||
== Bist du sicher, dass du beenden möchtest?
|
||||
|
@ -89,7 +89,7 @@ Aspect ratio
|
|||
== Seitenverhältnis
|
||||
|
||||
Automatically record demos
|
||||
== Automatisch Demos aufnehmen
|
||||
== Automatisch Aufnahmen erstellen
|
||||
|
||||
Automatically take game over screenshot
|
||||
== Bildschirmfotos autom. nach jeder Runde erstellen
|
||||
|
@ -124,9 +124,6 @@ Cancel
|
|||
Chat
|
||||
== Chat
|
||||
|
||||
Clear collision
|
||||
== Kollision löschen
|
||||
|
||||
Clip H
|
||||
== Aussch. H
|
||||
|
||||
|
@ -169,9 +166,6 @@ Connection Problems...
|
|||
Console
|
||||
== Konsole
|
||||
|
||||
Constructs collision from this layer
|
||||
== Erstellt die Kollision aus dieser Ebene
|
||||
|
||||
Controls
|
||||
== Steuerung
|
||||
|
||||
|
@ -209,7 +203,7 @@ Delete
|
|||
== Löschen
|
||||
|
||||
Delete demo
|
||||
== Demo löschen
|
||||
== Aufnahme löschen
|
||||
|
||||
Delete group
|
||||
== Gruppe löschen
|
||||
|
@ -227,7 +221,7 @@ Deletes the layer
|
|||
== Entfernt die Ebene
|
||||
|
||||
Demos
|
||||
== Demos
|
||||
== Aufnahm.
|
||||
|
||||
Detail
|
||||
== Detail
|
||||
|
@ -281,7 +275,7 @@ Error
|
|||
== Fehlgeschlagen
|
||||
|
||||
Error loading demo
|
||||
== Fehler beim Laden der Demo, die Datei ist ungültig.
|
||||
== Fehler beim Laden der Aufnahme, die Datei ist ungültig.
|
||||
|
||||
Exit
|
||||
== Beenden
|
||||
|
@ -401,7 +395,7 @@ Internet
|
|||
== Internet
|
||||
|
||||
Invalid Demo
|
||||
== Ungültige Demo
|
||||
== Ungültige Aufnahme
|
||||
|
||||
Join blue
|
||||
== zu Blau
|
||||
|
@ -457,9 +451,6 @@ Loading
|
|||
MOTD
|
||||
== Nachricht des Tages
|
||||
|
||||
Make collision
|
||||
== Kollision erstellen
|
||||
|
||||
Make external
|
||||
== Extern machen
|
||||
|
||||
|
@ -470,7 +461,7 @@ Max Screenshots
|
|||
== Maximale Bildschirmfotos
|
||||
|
||||
Max demos
|
||||
== Maximale Demos
|
||||
== Maximale Aufnahmen
|
||||
|
||||
Maximum ping:
|
||||
== Maximaler Ping:
|
||||
|
@ -632,7 +623,7 @@ Reason:
|
|||
== Grund
|
||||
|
||||
Record demo
|
||||
== Demo aufneh.
|
||||
== Aufnahme sta.
|
||||
|
||||
Red team
|
||||
== Rotes team
|
||||
|
@ -658,9 +649,6 @@ Remote console
|
|||
Remove
|
||||
== Entfernen
|
||||
|
||||
Removes collision from this layer
|
||||
== Entfernt die Kollision aus dieser Ebene
|
||||
|
||||
Removes the image from the map
|
||||
== Entfernt die Grafik aus der Karte
|
||||
|
||||
|
@ -863,7 +851,7 @@ UI Color
|
|||
== Menüfarbe
|
||||
|
||||
Unable to delete the demo
|
||||
== Demo konnte nicht gelöscht werden
|
||||
== Aufnahme konnte nicht gelöscht werden
|
||||
|
||||
Up
|
||||
== Oben
|
||||
|
@ -972,6 +960,24 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Clear
|
||||
==
|
||||
|
||||
Collision
|
||||
==
|
||||
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
##### DDRace #####
|
||||
|
|
|
@ -124,9 +124,6 @@ Cancel
|
|||
Chat
|
||||
== Chat
|
||||
|
||||
Clear collision
|
||||
== Cancella collisioni
|
||||
|
||||
Clip H
|
||||
== Alt. Taglio
|
||||
|
||||
|
@ -169,9 +166,6 @@ Connection Problems...
|
|||
Console
|
||||
== Console
|
||||
|
||||
Constructs collision from this layer
|
||||
== Costruisce le collisioni su questo livello
|
||||
|
||||
Controls
|
||||
== Controlli
|
||||
|
||||
|
@ -448,9 +442,6 @@ Loading
|
|||
MOTD
|
||||
== MDG
|
||||
|
||||
Make collision
|
||||
== Ricalca collisioni
|
||||
|
||||
Make external
|
||||
== Scorpora
|
||||
|
||||
|
@ -640,9 +631,6 @@ Remote console
|
|||
Remove
|
||||
== Rimuovi
|
||||
|
||||
Removes collision from this layer
|
||||
== Rimuove le collisioni presenti in questo livello
|
||||
|
||||
Removes the image from the map
|
||||
== Rivuove l'immagine dalla mappa
|
||||
|
||||
|
@ -942,12 +930,27 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Clear
|
||||
==
|
||||
|
||||
Collision
|
||||
==
|
||||
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
File
|
||||
==
|
||||
|
||||
File: %s
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
HD
|
||||
==
|
||||
|
||||
|
@ -969,6 +972,9 @@ Sound error
|
|||
Sudden Death
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
Warmup
|
||||
==
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
|
||||
##### translated strings #####
|
||||
|
||||
%d of %d servers, %d players
|
||||
|
@ -91,9 +91,6 @@ Cancel
|
|||
Chat
|
||||
== Chat
|
||||
|
||||
Clear collision
|
||||
== Wyczyść kolizję
|
||||
|
||||
Close
|
||||
== Zamknij
|
||||
|
||||
|
@ -121,9 +118,6 @@ Connection Problems...
|
|||
Console
|
||||
== Konsola
|
||||
|
||||
Constructs collision from this layer
|
||||
== Tworzy kolizję z tej warstwy
|
||||
|
||||
Controls
|
||||
== Sterowanie
|
||||
|
||||
|
@ -367,9 +361,6 @@ Loading
|
|||
MOTD
|
||||
== Wiadomość dnia
|
||||
|
||||
Make collision
|
||||
== Stwórz kolizję
|
||||
|
||||
Make external
|
||||
== Użyj jako zewnętrzny
|
||||
|
||||
|
@ -523,9 +514,6 @@ Remote console
|
|||
Remove
|
||||
== Usuń
|
||||
|
||||
Removes collision from this layer
|
||||
== Usuwa kolizję z tej warstwy
|
||||
|
||||
Removes the image from the map
|
||||
== Usuwa obrazek z mapy
|
||||
|
||||
|
@ -813,6 +801,9 @@ Automatically take game over screenshot
|
|||
Blue value of the envelope
|
||||
==
|
||||
|
||||
Clear
|
||||
==
|
||||
|
||||
Clip H
|
||||
==
|
||||
|
||||
|
@ -825,9 +816,18 @@ Clip X
|
|||
Clip Y
|
||||
==
|
||||
|
||||
Collision
|
||||
==
|
||||
|
||||
Color
|
||||
==
|
||||
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
Delete demo
|
||||
==
|
||||
|
||||
|
@ -852,6 +852,9 @@ File: %s
|
|||
Folder
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
Green value of the envelope
|
||||
==
|
||||
|
||||
|
@ -948,6 +951,9 @@ Time limit: %d min
|
|||
Unable to delete the demo
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
Up
|
||||
==
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
|
||||
##### translated strings #####
|
||||
|
||||
%d of %d servers, %d players
|
||||
|
@ -540,7 +540,7 @@ CW
|
|||
Cancel
|
||||
==
|
||||
|
||||
Clear collision
|
||||
Clear
|
||||
==
|
||||
|
||||
Clip H
|
||||
|
@ -555,6 +555,9 @@ Clip X
|
|||
Clip Y
|
||||
==
|
||||
|
||||
Collision
|
||||
==
|
||||
|
||||
Color
|
||||
==
|
||||
|
||||
|
@ -567,7 +570,7 @@ Color TO
|
|||
Color+
|
||||
==
|
||||
|
||||
Constructs collision from this layer
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Creates a new color envelope
|
||||
|
@ -585,6 +588,9 @@ Creates a new quad layer
|
|||
Creates a new tile layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
Decrease
|
||||
==
|
||||
|
||||
|
@ -657,6 +663,9 @@ Filename:
|
|||
Folder
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
Green value of the envelope
|
||||
==
|
||||
|
||||
|
@ -708,9 +717,6 @@ Load a new image to use in the map
|
|||
Load map
|
||||
==
|
||||
|
||||
Make collision
|
||||
==
|
||||
|
||||
Make external
|
||||
==
|
||||
|
||||
|
@ -807,9 +813,6 @@ Refocus
|
|||
Remove
|
||||
==
|
||||
|
||||
Removes collision from this layer
|
||||
==
|
||||
|
||||
Removes the image from the map
|
||||
==
|
||||
|
||||
|
@ -903,6 +906,9 @@ Toggles the envelope editor.
|
|||
Unable to delete the demo
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
Up
|
||||
==
|
||||
|
||||
|
|
|
@ -124,9 +124,6 @@ Cancel
|
|||
Chat
|
||||
== Chat
|
||||
|
||||
Clear collision
|
||||
== Curăță coliziunea
|
||||
|
||||
Clip H
|
||||
== Î clip
|
||||
|
||||
|
@ -169,9 +166,6 @@ Connection Problems...
|
|||
Console
|
||||
== Consolă
|
||||
|
||||
Constructs collision from this layer
|
||||
== Construiește coliziunea din acest strat
|
||||
|
||||
Controls
|
||||
== Controale
|
||||
|
||||
|
@ -457,9 +451,6 @@ Loading
|
|||
MOTD
|
||||
== Mesajul zilei
|
||||
|
||||
Make collision
|
||||
== Creează coliziunea
|
||||
|
||||
Make external
|
||||
== Fă-o externă
|
||||
|
||||
|
@ -658,9 +649,6 @@ Remote console
|
|||
Remove
|
||||
== Elimină
|
||||
|
||||
Removes collision from this layer
|
||||
== Elimină coliziunea din acest strat
|
||||
|
||||
Removes the image from the map
|
||||
== Elimină imaginea din hartă
|
||||
|
||||
|
@ -778,6 +766,9 @@ Skins
|
|||
Sound
|
||||
== Sunet
|
||||
|
||||
Sound error
|
||||
== Eroare de sunet
|
||||
|
||||
Sound volume
|
||||
== Volum sunet
|
||||
|
||||
|
@ -826,6 +817,9 @@ Teeworlds %s is out! Download it at www.teeworlds.com!
|
|||
Texture Compression
|
||||
== Compresie texturi
|
||||
|
||||
The audio device couldn't be initialised.
|
||||
== Dispozitivul audio nu a putut fi inițializat.
|
||||
|
||||
The server is running a non-standard tuning on a pure game type.
|
||||
== Serverul folosește parametri ne-standard într-un joc standard.
|
||||
|
||||
|
@ -966,10 +960,22 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Sound error
|
||||
Clear
|
||||
==
|
||||
|
||||
The audio device couldn't be initialised.
|
||||
Collision
|
||||
==
|
||||
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
|
|
@ -94,9 +94,6 @@ Cancel
|
|||
Chat
|
||||
== Чат
|
||||
|
||||
Clear collision
|
||||
== Очистить коллизии
|
||||
|
||||
Close
|
||||
== Закрыть
|
||||
|
||||
|
@ -124,9 +121,6 @@ Connection Problems...
|
|||
Console
|
||||
== Консоль
|
||||
|
||||
Constructs collision from this layer
|
||||
== Создать коллизии из этого слоя
|
||||
|
||||
Controls
|
||||
== Управление
|
||||
|
||||
|
@ -376,9 +370,6 @@ Loading
|
|||
MOTD
|
||||
== MOTD
|
||||
|
||||
Make collision
|
||||
== Создать коллизии
|
||||
|
||||
Make external
|
||||
== Сделать внешним
|
||||
|
||||
|
@ -538,9 +529,6 @@ Remote console
|
|||
Remove
|
||||
== Удалить
|
||||
|
||||
Removes collision from this layer
|
||||
== Удалить коллизии из этого слоя
|
||||
|
||||
Removes the image from the map
|
||||
== Удалить изображение из карты
|
||||
|
||||
|
@ -825,6 +813,9 @@ Automatically take game over screenshot
|
|||
Blue value of the envelope
|
||||
==
|
||||
|
||||
Clear
|
||||
==
|
||||
|
||||
Clip H
|
||||
==
|
||||
|
||||
|
@ -837,9 +828,18 @@ Clip X
|
|||
Clip Y
|
||||
==
|
||||
|
||||
Collision
|
||||
==
|
||||
|
||||
Color
|
||||
==
|
||||
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
Delete demo
|
||||
==
|
||||
|
||||
|
@ -861,6 +861,9 @@ File: %s
|
|||
Folder
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
Green value of the envelope
|
||||
==
|
||||
|
||||
|
@ -948,6 +951,9 @@ Time limit: %d min
|
|||
Unable to delete the demo
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
Up
|
||||
==
|
||||
|
||||
|
@ -975,6 +981,7 @@ no limit
|
|||
##### old translations #####
|
||||
|
||||
##### DDRace #####
|
||||
|
||||
Loading DDRace Client
|
||||
== Загрузка DDRace Client
|
||||
|
||||
|
|
|
@ -543,7 +543,7 @@ CW
|
|||
Cancel
|
||||
==
|
||||
|
||||
Clear collision
|
||||
Clear
|
||||
==
|
||||
|
||||
Clip H
|
||||
|
@ -558,6 +558,9 @@ Clip X
|
|||
Clip Y
|
||||
==
|
||||
|
||||
Collision
|
||||
==
|
||||
|
||||
Color
|
||||
==
|
||||
|
||||
|
@ -570,7 +573,7 @@ Color TO
|
|||
Color+
|
||||
==
|
||||
|
||||
Constructs collision from this layer
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Creates a new color envelope
|
||||
|
@ -588,6 +591,9 @@ Creates a new quad layer
|
|||
Creates a new tile layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
Decrease
|
||||
==
|
||||
|
||||
|
@ -657,6 +663,9 @@ Filename:
|
|||
Folder
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
Green value of the envelope
|
||||
==
|
||||
|
||||
|
@ -708,9 +717,6 @@ Load a new image to use in the map
|
|||
Load map
|
||||
==
|
||||
|
||||
Make collision
|
||||
==
|
||||
|
||||
Make external
|
||||
==
|
||||
|
||||
|
@ -807,9 +813,6 @@ Refocus
|
|||
Remove
|
||||
==
|
||||
|
||||
Removes collision from this layer
|
||||
==
|
||||
|
||||
Removes the image from the map
|
||||
==
|
||||
|
||||
|
@ -903,6 +906,9 @@ Toggles the envelope editor.
|
|||
Unable to delete the demo
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
Up
|
||||
==
|
||||
|
||||
|
|
|
@ -124,9 +124,6 @@ Cancel
|
|||
Chat
|
||||
== Charla
|
||||
|
||||
Clear collision
|
||||
== Limpiar colisión
|
||||
|
||||
Clip H
|
||||
== Clip H
|
||||
|
||||
|
@ -169,9 +166,6 @@ Connection Problems...
|
|||
Console
|
||||
== Consola
|
||||
|
||||
Constructs collision from this layer
|
||||
== Construir collisión para esta capa
|
||||
|
||||
Controls
|
||||
== Controles
|
||||
|
||||
|
@ -457,9 +451,6 @@ Loading
|
|||
MOTD
|
||||
== MOTD
|
||||
|
||||
Make collision
|
||||
== Fabricar colisión
|
||||
|
||||
Make external
|
||||
== Fabricar exterior
|
||||
|
||||
|
@ -658,9 +649,6 @@ Remote console
|
|||
Remove
|
||||
== Remover
|
||||
|
||||
Removes collision from this layer
|
||||
== Remover colisión para esta capa
|
||||
|
||||
Removes the image from the map
|
||||
== Remover la imagen de este mapa
|
||||
|
||||
|
@ -972,6 +960,24 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Clear
|
||||
==
|
||||
|
||||
Collision
|
||||
==
|
||||
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
##### DDRace #####
|
||||
|
|
|
@ -513,7 +513,7 @@ CW
|
|||
Cancel
|
||||
==
|
||||
|
||||
Clear collision
|
||||
Clear
|
||||
==
|
||||
|
||||
Clip H
|
||||
|
@ -528,6 +528,9 @@ Clip X
|
|||
Clip Y
|
||||
==
|
||||
|
||||
Collision
|
||||
==
|
||||
|
||||
Color
|
||||
==
|
||||
|
||||
|
@ -543,7 +546,7 @@ Color+
|
|||
Connection Problems...
|
||||
==
|
||||
|
||||
Constructs collision from this layer
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Creates a new color envelope
|
||||
|
@ -561,6 +564,9 @@ Creates a new quad layer
|
|||
Creates a new tile layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
Decrease
|
||||
==
|
||||
|
||||
|
@ -642,6 +648,9 @@ Folder
|
|||
Force vote
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
Green value of the envelope
|
||||
==
|
||||
|
||||
|
@ -693,9 +702,6 @@ Load a new image to use in the map
|
|||
Load map
|
||||
==
|
||||
|
||||
Make collision
|
||||
==
|
||||
|
||||
Make external
|
||||
==
|
||||
|
||||
|
@ -795,9 +801,6 @@ Refocus
|
|||
Remove
|
||||
==
|
||||
|
||||
Removes collision from this layer
|
||||
==
|
||||
|
||||
Removes the image from the map
|
||||
==
|
||||
|
||||
|
@ -897,6 +900,9 @@ Toggles the envelope editor.
|
|||
Unable to delete the demo
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
Up
|
||||
==
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
|
||||
##### translated strings #####
|
||||
|
||||
%d of %d servers, %d players
|
||||
|
@ -100,9 +100,6 @@ Cancel
|
|||
Chat
|
||||
== Чат
|
||||
|
||||
Clear collision
|
||||
== Очистити колізію
|
||||
|
||||
Close
|
||||
== Закрити
|
||||
|
||||
|
@ -130,9 +127,6 @@ Connection Problems...
|
|||
Console
|
||||
== Консоль
|
||||
|
||||
Constructs collision from this layer
|
||||
== Створити колізії з цього шару
|
||||
|
||||
Controls
|
||||
== Управління
|
||||
|
||||
|
@ -400,9 +394,6 @@ Loading
|
|||
MOTD
|
||||
== MOTD
|
||||
|
||||
Make collision
|
||||
== Створити колізії
|
||||
|
||||
Make external
|
||||
== Зробити зовнішнім
|
||||
|
||||
|
@ -568,9 +559,6 @@ Remote console
|
|||
Remove
|
||||
== Видалити
|
||||
|
||||
Removes collision from this layer
|
||||
== Видалити колізії з цього шару
|
||||
|
||||
Removes the image from the map
|
||||
== Видалити зображення з карти
|
||||
|
||||
|
@ -873,6 +861,9 @@ Automatically take game over screenshot
|
|||
Blue value of the envelope
|
||||
==
|
||||
|
||||
Clear
|
||||
==
|
||||
|
||||
Clip H
|
||||
==
|
||||
|
||||
|
@ -885,9 +876,18 @@ Clip X
|
|||
Clip Y
|
||||
==
|
||||
|
||||
Collision
|
||||
==
|
||||
|
||||
Color
|
||||
==
|
||||
|
||||
Constructs game tiles from this layer
|
||||
==
|
||||
|
||||
Death
|
||||
==
|
||||
|
||||
Delete demo
|
||||
==
|
||||
|
||||
|
@ -897,6 +897,9 @@ Delete this envelope
|
|||
File: %s
|
||||
==
|
||||
|
||||
Game tiles
|
||||
==
|
||||
|
||||
Green value of the envelope
|
||||
==
|
||||
|
||||
|
@ -954,6 +957,9 @@ The audio device couldn't be initialised.
|
|||
Unable to delete the demo
|
||||
==
|
||||
|
||||
Unhookable
|
||||
==
|
||||
|
||||
Up
|
||||
==
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ class Weapons(Struct):
|
|||
def __init__(self):
|
||||
Struct.__init__(self, "WEAPONSPECS")
|
||||
self.hammer = Weapon_Hammer()
|
||||
self.gun = Weapon_Hammer()
|
||||
self.gun = Weapon_Gun()
|
||||
self.shotgun = Weapon_Shotgun()
|
||||
self.grenade = Weapon_Grenade()
|
||||
self.rifle = Weapon_Rifle()
|
||||
|
|
|
@ -147,7 +147,7 @@ Objects = [
|
|||
|
||||
NetObject("PlayerInfo", [
|
||||
NetIntRange("m_Local", 0, 1),
|
||||
NetIntRange("m_ClientId", 0, 'MAX_CLIENTS-1'),
|
||||
NetIntRange("m_ClientID", 0, 'MAX_CLIENTS-1'),
|
||||
NetIntRange("m_Team", 'TEAM_SPECTATORS', 'TEAM_BLUE'),
|
||||
|
||||
NetIntAny("m_Score"),
|
||||
|
@ -183,15 +183,15 @@ Objects = [
|
|||
NetEvent("HammerHit:Common", []),
|
||||
|
||||
NetEvent("Death:Common", [
|
||||
NetIntRange("m_ClientId", 0, 'MAX_CLIENTS-1'),
|
||||
NetIntRange("m_ClientID", 0, 'MAX_CLIENTS-1'),
|
||||
]),
|
||||
|
||||
NetEvent("SoundGlobal:Common", [
|
||||
NetIntRange("m_SoundId", 0, 'NUM_SOUNDS-1'),
|
||||
NetIntRange("m_SoundID", 0, 'NUM_SOUNDS-1'),
|
||||
]),
|
||||
|
||||
NetEvent("SoundWorld:Common", [
|
||||
NetIntRange("m_SoundId", 0, 'NUM_SOUNDS-1'),
|
||||
NetIntRange("m_SoundID", 0, 'NUM_SOUNDS-1'),
|
||||
]),
|
||||
|
||||
NetEvent("DamageInd:Common", [
|
||||
|
@ -212,7 +212,7 @@ Messages = [
|
|||
|
||||
NetMessage("Sv_Chat", [
|
||||
NetIntRange("m_Team", 'TEAM_SPECTATORS', 'TEAM_BLUE'),
|
||||
NetIntRange("m_Cid", -1, 'MAX_CLIENTS-1'),
|
||||
NetIntRange("m_ClientID", -1, 'MAX_CLIENTS-1'),
|
||||
NetString("m_pMessage"),
|
||||
]),
|
||||
|
||||
|
@ -224,7 +224,7 @@ Messages = [
|
|||
]),
|
||||
|
||||
NetMessage("Sv_SoundGlobal", [
|
||||
NetIntRange("m_Soundid", 0, 'NUM_SOUNDS-1'),
|
||||
NetIntRange("m_SoundID", 0, 'NUM_SOUNDS-1'),
|
||||
]),
|
||||
|
||||
NetMessage("Sv_TuneParams", []),
|
||||
|
@ -236,7 +236,7 @@ Messages = [
|
|||
]),
|
||||
|
||||
NetMessage("Sv_Emoticon", [
|
||||
NetIntRange("m_Cid", 0, 'MAX_CLIENTS-1'),
|
||||
NetIntRange("m_ClientID", 0, 'MAX_CLIENTS-1'),
|
||||
NetIntRange("m_Emoticon", 0, 'NUM_EMOTICONS-1'),
|
||||
]),
|
||||
|
||||
|
@ -317,7 +317,7 @@ Messages = [
|
|||
|
||||
NetMessage("Sv_PlayerTime", [
|
||||
NetIntAny("m_Time"),
|
||||
NetIntRange("m_Cid", 0, 'MAX_CLIENTS-1'),
|
||||
NetIntRange("m_ClientID", 0, 'MAX_CLIENTS-1'),
|
||||
]),
|
||||
|
||||
NetMessage("Cl_TeamsState", [
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import hashlib, sys, re
|
||||
|
||||
alphanum = "0123456789abcdefghijklmnopqrstuvwzyxABCDEFGHIJKLMNOPQRSTUVWXYZ_"
|
||||
alphanum = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_".encode()
|
||||
|
||||
def cstrip(lines):
|
||||
d = "".encode()
|
||||
|
@ -12,15 +12,15 @@ def cstrip(lines):
|
|||
d = d.replace("\t".encode(), " ".encode()) # tab to space
|
||||
d = re.sub(" *".encode(), " ".encode(), d) # remove double spaces
|
||||
d = re.sub("".encode(), "".encode(), d) # remove /* */ comments
|
||||
|
||||
|
||||
d = d.strip()
|
||||
|
||||
|
||||
# this eats up cases like 'n {'
|
||||
i = 1
|
||||
while i < len(d)-2:
|
||||
if d[i:i + 1] == " ":
|
||||
if not (d[i-1:i] in alphanum and d[i+1:i + 2] in alphanum):
|
||||
d = d[:i] + d[i+1:]
|
||||
if d[i:i + 1] == " ".encode():
|
||||
if not (d[i - 1:i] in alphanum and d[i+1:i + 2] in alphanum):
|
||||
d = d[:i] + d[i + 1:]
|
||||
i += 1
|
||||
return d
|
||||
|
||||
|
@ -31,6 +31,6 @@ for filename in sys.argv[1:]:
|
|||
hash = hashlib.md5(f).hexdigest().lower()[16:]
|
||||
# TODO: refactor hash that is equal to the 0.5 hash, remove when we
|
||||
# TODO: remove when we don't need it any more
|
||||
if hash == "f16c2456fc487748":
|
||||
if hash == "c139dc3e0152dff6":
|
||||
hash = "b67d1f1a1eea234e"
|
||||
print('#define GAME_NETVERSION_HASH "%s"' % hash)
|
||||
|
|
|
@ -89,7 +89,16 @@ void dbg_msg(const char *sys, const char *fmt, ...)
|
|||
char *msg;
|
||||
int i, len;
|
||||
|
||||
str_format(str, sizeof(str), "[%08x][%s]: ", (int)time(0), sys);
|
||||
time_t rawtime;
|
||||
struct tm * timeinfo;
|
||||
char timestr [80];
|
||||
|
||||
time ( &rawtime );
|
||||
timeinfo = localtime ( &rawtime );
|
||||
|
||||
strftime (timestr,sizeof(timestr),"%y-%m-%d %H:%M:%S",timeinfo);
|
||||
str_format(str, sizeof(str), "[%s][%s]: ", timestr, sys);
|
||||
|
||||
len = strlen(str);
|
||||
msg = (char *)str + len;
|
||||
|
||||
|
@ -1345,7 +1354,7 @@ void gui_messagebox(const char *title, const char *message)
|
|||
title,
|
||||
message);
|
||||
|
||||
(void)system(cmd);
|
||||
int err = system(cmd);
|
||||
#elif defined(CONF_FAMILY_WINDOWS)
|
||||
MessageBox(NULL,
|
||||
message,
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
{
|
||||
public:
|
||||
int m_Type;
|
||||
int m_Id;
|
||||
int m_ID;
|
||||
int m_DataSize;
|
||||
};
|
||||
|
||||
|
@ -108,10 +108,10 @@ public:
|
|||
};
|
||||
|
||||
// TODO: Refactor: should redo this a bit i think, too many virtual calls
|
||||
virtual int SnapNumItems(int SnapId) = 0;
|
||||
virtual void *SnapFindItem(int SnapId, int Type, int Id) = 0;
|
||||
virtual void *SnapGetItem(int SnapId, int Index, CSnapItem *pItem) = 0;
|
||||
virtual void SnapInvalidateItem(int SnapId, int Index) = 0;
|
||||
virtual int SnapNumItems(int SnapID) = 0;
|
||||
virtual void *SnapFindItem(int SnapID, int Type, int ID) = 0;
|
||||
virtual void *SnapGetItem(int SnapID, int Index, CSnapItem *pItem) = 0;
|
||||
virtual void SnapInvalidateItem(int SnapID, int Index) = 0;
|
||||
|
||||
virtual void SnapSetStaticsize(int ItemType, int Size) = 0;
|
||||
|
||||
|
@ -131,14 +131,16 @@ public:
|
|||
virtual const char *LatestVersion() = 0;
|
||||
virtual bool ConnectionProblems() = 0;
|
||||
|
||||
virtual bool SoundInitFailed() = 0;
|
||||
|
||||
//DDRace
|
||||
|
||||
virtual const char* GetCurrentMap() = 0;
|
||||
virtual int GetCurrentMapCrc() = 0;
|
||||
virtual const char* RaceRecordStart(const char *pFilename) = 0;
|
||||
virtual void RaceRecordStop() = 0;
|
||||
virtual bool DemoIsRecording() = 0;
|
||||
|
||||
virtual bool SoundInitFailed() = 0;
|
||||
};
|
||||
|
||||
class IGameClient : public IInterface
|
||||
|
@ -156,7 +158,7 @@ public:
|
|||
virtual void OnRender() = 0;
|
||||
virtual void OnStateChange(int NewState, int OldState) = 0;
|
||||
virtual void OnConnected() = 0;
|
||||
virtual void OnMessage(int MsgId, CUnpacker *pUnpacker) = 0;
|
||||
virtual void OnMessage(int MsgID, CUnpacker *pUnpacker) = 0;
|
||||
virtual void OnPredict() = 0;
|
||||
virtual void OnActivateEditor() = 0;
|
||||
|
||||
|
|
|
@ -771,55 +771,55 @@ int CClient::LoadData()
|
|||
|
||||
// ---
|
||||
|
||||
void *CClient::SnapGetItem(int SnapId, int Index, CSnapItem *pItem)
|
||||
void *CClient::SnapGetItem(int SnapID, int Index, CSnapItem *pItem)
|
||||
{
|
||||
CSnapshotItem *i;
|
||||
dbg_assert(SnapId >= 0 && SnapId < NUM_SNAPSHOT_TYPES, "invalid SnapId");
|
||||
i = m_aSnapshots[SnapId]->m_pAltSnap->GetItem(Index);
|
||||
pItem->m_DataSize = m_aSnapshots[SnapId]->m_pAltSnap->GetItemSize(Index);
|
||||
dbg_assert(SnapID >= 0 && SnapID < NUM_SNAPSHOT_TYPES, "invalid SnapID");
|
||||
i = m_aSnapshots[SnapID]->m_pAltSnap->GetItem(Index);
|
||||
pItem->m_DataSize = m_aSnapshots[SnapID]->m_pAltSnap->GetItemSize(Index);
|
||||
pItem->m_Type = i->Type();
|
||||
pItem->m_Id = i->ID();
|
||||
pItem->m_ID = i->ID();
|
||||
return (void *)i->Data();
|
||||
}
|
||||
|
||||
void CClient::SnapInvalidateItem(int SnapId, int Index)
|
||||
void CClient::SnapInvalidateItem(int SnapID, int Index)
|
||||
{
|
||||
CSnapshotItem *i;
|
||||
dbg_assert(SnapId >= 0 && SnapId < NUM_SNAPSHOT_TYPES, "invalid SnapId");
|
||||
i = m_aSnapshots[SnapId]->m_pAltSnap->GetItem(Index);
|
||||
dbg_assert(SnapID >= 0 && SnapID < NUM_SNAPSHOT_TYPES, "invalid SnapID");
|
||||
i = m_aSnapshots[SnapID]->m_pAltSnap->GetItem(Index);
|
||||
if(i)
|
||||
{
|
||||
if((char *)i < (char *)m_aSnapshots[SnapId]->m_pAltSnap || (char *)i > (char *)m_aSnapshots[SnapId]->m_pAltSnap + m_aSnapshots[SnapId]->m_SnapSize)
|
||||
if((char *)i < (char *)m_aSnapshots[SnapID]->m_pAltSnap || (char *)i > (char *)m_aSnapshots[SnapID]->m_pAltSnap + m_aSnapshots[SnapID]->m_SnapSize)
|
||||
m_pConsole->Print(IConsole::OUTPUT_LEVEL_DEBUG, "client", "snap invalidate problem");
|
||||
if((char *)i >= (char *)m_aSnapshots[SnapId]->m_pSnap && (char *)i < (char *)m_aSnapshots[SnapId]->m_pSnap + m_aSnapshots[SnapId]->m_SnapSize)
|
||||
if((char *)i >= (char *)m_aSnapshots[SnapID]->m_pSnap && (char *)i < (char *)m_aSnapshots[SnapID]->m_pSnap + m_aSnapshots[SnapID]->m_SnapSize)
|
||||
m_pConsole->Print(IConsole::OUTPUT_LEVEL_DEBUG, "client", "snap invalidate problem");
|
||||
i->m_TypeAndID = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void *CClient::SnapFindItem(int SnapId, int Type, int Id)
|
||||
void *CClient::SnapFindItem(int SnapID, int Type, int ID)
|
||||
{
|
||||
// TODO: linear search. should be fixed.
|
||||
int i;
|
||||
|
||||
if(!m_aSnapshots[SnapId])
|
||||
if(!m_aSnapshots[SnapID])
|
||||
return 0x0;
|
||||
|
||||
for(i = 0; i < m_aSnapshots[SnapId]->m_pSnap->NumItems(); i++)
|
||||
for(i = 0; i < m_aSnapshots[SnapID]->m_pSnap->NumItems(); i++)
|
||||
{
|
||||
CSnapshotItem *pItem = m_aSnapshots[SnapId]->m_pAltSnap->GetItem(i);
|
||||
if(pItem->Type() == Type && pItem->ID() == Id)
|
||||
CSnapshotItem *pItem = m_aSnapshots[SnapID]->m_pAltSnap->GetItem(i);
|
||||
if(pItem->Type() == Type && pItem->ID() == ID)
|
||||
return (void *)pItem->Data();
|
||||
}
|
||||
return 0x0;
|
||||
}
|
||||
|
||||
int CClient::SnapNumItems(int SnapId)
|
||||
int CClient::SnapNumItems(int SnapID)
|
||||
{
|
||||
dbg_assert(SnapId >= 0 && SnapId < NUM_SNAPSHOT_TYPES, "invalid SnapId");
|
||||
if(!m_aSnapshots[SnapId])
|
||||
dbg_assert(SnapID >= 0 && SnapID < NUM_SNAPSHOT_TYPES, "invalid SnapID");
|
||||
if(!m_aSnapshots[SnapID])
|
||||
return 0;
|
||||
return m_aSnapshots[SnapId]->m_pSnap->NumItems();
|
||||
return m_aSnapshots[SnapID]->m_pSnap->NumItems();
|
||||
}
|
||||
|
||||
void CClient::SnapSetStaticsize(int ItemType, int Size)
|
||||
|
@ -2219,6 +2219,23 @@ void CClient::RegisterCommands()
|
|||
m_pConsole->Register("record", "?s", CFGFLAG_SERVER, 0, 0, "Record to a file", 0);
|
||||
m_pConsole->Register("stoprecord", "", CFGFLAG_SERVER, 0, 0, "Stop recording", 0);
|
||||
m_pConsole->Register("reload", "", CFGFLAG_SERVER, 0, 0, "Reload the map", 0);
|
||||
|
||||
m_pConsole->Register("quit", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Quit, this, "Quit Teeworlds", -1);
|
||||
m_pConsole->Register("exit", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Quit, this, "Quit Teeworlds", -1);
|
||||
m_pConsole->Register("minimize", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Minimize, this, "Minimize Teeworlds", -1);
|
||||
m_pConsole->Register("connect", "s", CFGFLAG_CLIENT, Con_Connect, this, "Connect to the specified host/ip", -1);
|
||||
m_pConsole->Register("disconnect", "", CFGFLAG_CLIENT, Con_Disconnect, this, "Disconnect from the server", -1);
|
||||
m_pConsole->Register("ping", "", CFGFLAG_CLIENT, Con_Ping, this, "Ping the current server", -1);
|
||||
m_pConsole->Register("screenshot", "", CFGFLAG_CLIENT, Con_Screenshot, this, "Take a screenshot", -1);
|
||||
m_pConsole->Register("rcon", "r", CFGFLAG_CLIENT, Con_Rcon, this, "Send specified command to rcon", -1);
|
||||
m_pConsole->Register("rcon_auth", "s", CFGFLAG_CLIENT, Con_RconAuth, this, "Authenticate to rcon", -1);
|
||||
m_pConsole->Register("play", "r", CFGFLAG_CLIENT, Con_Play, this, "Play the file specified", -1);
|
||||
m_pConsole->Register("record", "?s", CFGFLAG_CLIENT, Con_Record, this, "Record to the file", -1);
|
||||
m_pConsole->Register("stoprecord", "", CFGFLAG_CLIENT, Con_StopRecord, this, "Stop recording", -1);
|
||||
|
||||
m_pConsole->Register("add_favorite", "s", CFGFLAG_CLIENT, Con_AddFavorite, this, "Add a server as a favorite", -1);
|
||||
|
||||
// DDRace
|
||||
m_pConsole->Register("login", "?s", CFGFLAG_SERVER, 0, 0, "Allows you access to rcon if no password is given, or changes your level if a password is given", -1);
|
||||
m_pConsole->Register("auth", "?s", CFGFLAG_SERVER, 0, 0, "Allows you access to rcon if no password is given, or changes your level if a password is given", -1);
|
||||
m_pConsole->Register("vote", "r", CFGFLAG_SERVER, 0, 0, "Forces the current vote to result in r (Yes/No)", 3);
|
||||
|
@ -2226,21 +2243,6 @@ void CClient::RegisterCommands()
|
|||
|
||||
#define CONSOLE_COMMAND(name, params, flags, callback, userdata, help, level) m_pConsole->Register(name, params, flags, 0, 0, help, level);
|
||||
#include <game/ddracecommands.h>
|
||||
|
||||
m_pConsole->Register("quit", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Quit, this, "Quit Teeworlds", 0);
|
||||
m_pConsole->Register("exit", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Quit, this, "Quit Teeworlds", 0);
|
||||
m_pConsole->Register("minimize", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Minimize, this, "Minimize Teeworlds", 0);
|
||||
m_pConsole->Register("connect", "s", CFGFLAG_CLIENT, Con_Connect, this, "Connect to the specified host/ip", 0);
|
||||
m_pConsole->Register("disconnect", "", CFGFLAG_CLIENT, Con_Disconnect, this, "Disconnect from the server", 0);
|
||||
m_pConsole->Register("ping", "", CFGFLAG_CLIENT, Con_Ping, this, "Ping the current server", 0);
|
||||
m_pConsole->Register("screenshot", "", CFGFLAG_CLIENT, Con_Screenshot, this, "Take a screenshot", 0);
|
||||
m_pConsole->Register("rcon", "r", CFGFLAG_CLIENT, Con_Rcon, this, "Send specified command to rcon", 0);
|
||||
m_pConsole->Register("rcon_auth", "s", CFGFLAG_CLIENT, Con_RconAuth, this, "Authenticate to rcon", 0);
|
||||
m_pConsole->Register("play", "r", CFGFLAG_CLIENT, Con_Play, this, "Play the file specified", 0);
|
||||
m_pConsole->Register("record", "?s", CFGFLAG_CLIENT, Con_Record, this, "Record to the file", 0);
|
||||
m_pConsole->Register("stoprecord", "", CFGFLAG_CLIENT, Con_StopRecord, this, "Stop recording", 0);
|
||||
|
||||
m_pConsole->Register("add_favorite", "s", CFGFLAG_CLIENT, Con_AddFavorite, this, "Add a server as a favorite", 0);
|
||||
}
|
||||
|
||||
static CClient m_Client;
|
||||
|
|
|
@ -266,10 +266,10 @@ public:
|
|||
|
||||
// ---
|
||||
|
||||
void *SnapGetItem(int SnapId, int Index, CSnapItem *pItem);
|
||||
void SnapInvalidateItem(int SnapId, int Index);
|
||||
void *SnapFindItem(int SnapId, int Type, int Id);
|
||||
int SnapNumItems(int SnapId);
|
||||
void *SnapGetItem(int SnapID, int Index, CSnapItem *pItem);
|
||||
void SnapInvalidateItem(int SnapID, int Index);
|
||||
void *SnapFindItem(int SnapID, int Type, int ID);
|
||||
int SnapNumItems(int SnapID);
|
||||
void SnapSetStaticsize(int ItemType, int Size);
|
||||
|
||||
void Render();
|
||||
|
@ -316,13 +316,6 @@ public:
|
|||
static void Con_Record(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void Con_StopRecord(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
|
||||
//DDRace
|
||||
virtual const char* GetCurrentMap();
|
||||
virtual int GetCurrentMapCrc();
|
||||
virtual const char* RaceRecordStart(const char *pFilename);
|
||||
virtual void RaceRecordStop();
|
||||
virtual bool DemoIsRecording();
|
||||
|
||||
void RegisterCommands();
|
||||
|
||||
const char *DemoPlayer_Play(const char *pFilename, int StorageType);
|
||||
|
@ -334,5 +327,13 @@ public:
|
|||
void AutoScreenshot_Cleanup();
|
||||
|
||||
virtual class CEngine *Engine() { return &m_Engine; }
|
||||
|
||||
// DDRace
|
||||
virtual const char* GetCurrentMap();
|
||||
virtual int GetCurrentMapCrc();
|
||||
virtual const char* RaceRecordStart(const char *pFilename);
|
||||
virtual void RaceRecordStop();
|
||||
virtual bool DemoIsRecording();
|
||||
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -357,7 +357,7 @@ int CGraphics_OpenGL::LoadTextureRaw(int Width, int Height, int Format, const vo
|
|||
int CGraphics_OpenGL::LoadTexture(const char *pFilename, int StorageType, int StoreFormat, int Flags)
|
||||
{
|
||||
int l = str_length(pFilename);
|
||||
int Id;
|
||||
int ID;
|
||||
CImageInfo Img;
|
||||
|
||||
if(l < 3)
|
||||
|
@ -367,9 +367,9 @@ int CGraphics_OpenGL::LoadTexture(const char *pFilename, int StorageType, int St
|
|||
if (StoreFormat == CImageInfo::FORMAT_AUTO)
|
||||
StoreFormat = Img.m_Format;
|
||||
|
||||
Id = LoadTextureRaw(Img.m_Width, Img.m_Height, Img.m_Format, Img.m_pData, StoreFormat, Flags);
|
||||
ID = LoadTextureRaw(Img.m_Width, Img.m_Height, Img.m_Format, Img.m_pData, StoreFormat, Flags);
|
||||
mem_free(Img.m_pData);
|
||||
return Id;
|
||||
return ID;
|
||||
}
|
||||
|
||||
return m_InvalidTexture;
|
||||
|
|
|
@ -253,21 +253,21 @@ int CSound::Shutdown()
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CSound::AllocId()
|
||||
int CSound::AllocID()
|
||||
{
|
||||
// TODO: linear search, get rid of it
|
||||
for(unsigned SampleId = 0; SampleId < NUM_SAMPLES; SampleId++)
|
||||
for(unsigned SampleID = 0; SampleID < NUM_SAMPLES; SampleID++)
|
||||
{
|
||||
if(m_aSamples[SampleId].m_pData == 0x0)
|
||||
return SampleId;
|
||||
if(m_aSamples[SampleID].m_pData == 0x0)
|
||||
return SampleID;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void CSound::RateConvert(int SampleId)
|
||||
void CSound::RateConvert(int SampleID)
|
||||
{
|
||||
CSample *pSample = &m_aSamples[SampleId];
|
||||
CSample *pSample = &m_aSamples[SampleID];
|
||||
int NumFrames = 0;
|
||||
short *pNewData = 0;
|
||||
|
||||
|
@ -311,7 +311,7 @@ int CSound::ReadData(void *pBuffer, int Size)
|
|||
int CSound::LoadWV(const char *pFilename)
|
||||
{
|
||||
CSample *pSample;
|
||||
int SampleId = -1;
|
||||
int SampleID = -1;
|
||||
char aError[100];
|
||||
WavpackContext *pContext;
|
||||
|
||||
|
@ -333,10 +333,10 @@ int CSound::LoadWV(const char *pFilename)
|
|||
return -1;
|
||||
}
|
||||
|
||||
SampleId = AllocId();
|
||||
if(SampleId < 0)
|
||||
SampleID = AllocID();
|
||||
if(SampleID < 0)
|
||||
return -1;
|
||||
pSample = &m_aSamples[SampleId];
|
||||
pSample = &m_aSamples[SampleID];
|
||||
|
||||
pContext = WavpackOpenFileInput(ReadData, aError);
|
||||
if (pContext)
|
||||
|
@ -399,8 +399,8 @@ int CSound::LoadWV(const char *pFilename)
|
|||
if(g_Config.m_Debug)
|
||||
dbg_msg("sound/wv", "loaded %s", pFilename);
|
||||
|
||||
RateConvert(SampleId);
|
||||
return SampleId;
|
||||
RateConvert(SampleID);
|
||||
return SampleID;
|
||||
}
|
||||
|
||||
void CSound::SetListenerPos(float x, float y)
|
||||
|
@ -410,15 +410,15 @@ void CSound::SetListenerPos(float x, float y)
|
|||
}
|
||||
|
||||
|
||||
void CSound::SetChannel(int ChannelId, float Vol, float Pan)
|
||||
void CSound::SetChannel(int ChannelID, float Vol, float Pan)
|
||||
{
|
||||
m_aChannels[ChannelId].m_Vol = (int)(Vol*255.0f);
|
||||
m_aChannels[ChannelId].m_Pan = (int)(Pan*255.0f); // TODO: this is only on and off right now
|
||||
m_aChannels[ChannelID].m_Vol = (int)(Vol*255.0f);
|
||||
m_aChannels[ChannelID].m_Pan = (int)(Pan*255.0f); // TODO: this is only on and off right now
|
||||
}
|
||||
|
||||
int CSound::Play(int ChannelId, int SampleId, int Flags, float x, float y)
|
||||
int CSound::Play(int ChannelID, int SampleID, int Flags, float x, float y)
|
||||
{
|
||||
int VoiceId = -1;
|
||||
int VoiceID = -1;
|
||||
int i;
|
||||
|
||||
lock_wait(m_SoundLock);
|
||||
|
@ -429,43 +429,43 @@ int CSound::Play(int ChannelId, int SampleId, int Flags, float x, float y)
|
|||
int id = (m_NextVoice + i) % NUM_VOICES;
|
||||
if(!m_aVoices[id].m_pSample)
|
||||
{
|
||||
VoiceId = id;
|
||||
VoiceID = id;
|
||||
m_NextVoice = id+1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// voice found, use it
|
||||
if(VoiceId != -1)
|
||||
if(VoiceID != -1)
|
||||
{
|
||||
m_aVoices[VoiceId].m_pSample = &m_aSamples[SampleId];
|
||||
m_aVoices[VoiceId].m_pChannel = &m_aChannels[ChannelId];
|
||||
m_aVoices[VoiceId].m_Tick = 0;
|
||||
m_aVoices[VoiceId].m_Vol = 255;
|
||||
m_aVoices[VoiceId].m_Flags = Flags;
|
||||
m_aVoices[VoiceId].m_X = (int)x;
|
||||
m_aVoices[VoiceId].m_Y = (int)y;
|
||||
m_aVoices[VoiceID].m_pSample = &m_aSamples[SampleID];
|
||||
m_aVoices[VoiceID].m_pChannel = &m_aChannels[ChannelID];
|
||||
m_aVoices[VoiceID].m_Tick = 0;
|
||||
m_aVoices[VoiceID].m_Vol = 255;
|
||||
m_aVoices[VoiceID].m_Flags = Flags;
|
||||
m_aVoices[VoiceID].m_X = (int)x;
|
||||
m_aVoices[VoiceID].m_Y = (int)y;
|
||||
}
|
||||
|
||||
lock_release(m_SoundLock);
|
||||
return VoiceId;
|
||||
return VoiceID;
|
||||
}
|
||||
|
||||
int CSound::PlayAt(int ChannelId, int SampleId, int Flags, float x, float y)
|
||||
int CSound::PlayAt(int ChannelID, int SampleID, int Flags, float x, float y)
|
||||
{
|
||||
return Play(ChannelId, SampleId, Flags|ISound::FLAG_POS, x, y);
|
||||
return Play(ChannelID, SampleID, Flags|ISound::FLAG_POS, x, y);
|
||||
}
|
||||
|
||||
int CSound::Play(int ChannelId, int SampleId, int Flags)
|
||||
int CSound::Play(int ChannelID, int SampleID, int Flags)
|
||||
{
|
||||
return Play(ChannelId, SampleId, Flags, 0, 0);
|
||||
return Play(ChannelID, SampleID, Flags, 0, 0);
|
||||
}
|
||||
|
||||
void CSound::Stop(int VoiceId)
|
||||
void CSound::Stop(int VoiceID)
|
||||
{
|
||||
// TODO: a nice fade out
|
||||
lock_wait(m_SoundLock);
|
||||
m_aVoices[VoiceId].m_pSample = 0;
|
||||
m_aVoices[VoiceID].m_pSample = 0;
|
||||
lock_release(m_SoundLock);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@ public:
|
|||
|
||||
int Update();
|
||||
int Shutdown();
|
||||
int AllocId();
|
||||
int AllocID();
|
||||
|
||||
static void RateConvert(int SampleId);
|
||||
static void RateConvert(int SampleID);
|
||||
|
||||
// TODO: Refactor: clean this mess up
|
||||
static IOHANDLE ms_File;
|
||||
|
@ -29,12 +29,12 @@ public:
|
|||
virtual int LoadWV(const char *pFilename);
|
||||
|
||||
virtual void SetListenerPos(float x, float y);
|
||||
virtual void SetChannel(int ChannelId, float Vol, float Pan);
|
||||
virtual void SetChannel(int ChannelID, float Vol, float Pan);
|
||||
|
||||
int Play(int ChannelId, int SampleId, int Flags, float x, float y);
|
||||
virtual int PlayAt(int ChannelId, int SampleId, int Flags, float x, float y);
|
||||
virtual int Play(int ChannelId, int SampleId, int Flags);
|
||||
virtual void Stop(int VoiceId);
|
||||
int Play(int ChannelID, int SampleID, int Flags, float x, float y);
|
||||
virtual int PlayAt(int ChannelID, int SampleID, int Flags, float x, float y);
|
||||
virtual int Play(int ChannelID, int SampleID, int Flags);
|
||||
virtual void Stop(int VoiceID);
|
||||
virtual void StopAll();
|
||||
};
|
||||
|
||||
|
|
|
@ -274,10 +274,8 @@ void CServerBrowser::Filter()
|
|||
Filtered = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (str_comp_nocase(m_ppServerlist[i]->m_Info.m_aGameType, g_Config.m_BrFilterGametype))
|
||||
Filtered = 1;
|
||||
}
|
||||
if(!str_find_nocase(m_ppServerlist[i]->m_Info.m_aGameType, g_Config.m_BrFilterGametype))
|
||||
Filtered = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -573,7 +571,7 @@ void CServerBrowser::Refresh(int Type)
|
|||
Packet.m_pData = Buffer;
|
||||
m_BroadcastTime = time_get();
|
||||
|
||||
for(i = 8303; i <= 8330; i++)
|
||||
for(i = 8303; i <= 8310; i++)
|
||||
{
|
||||
Packet.m_Address.port = i;
|
||||
m_pNetClient->Send(&Packet);
|
||||
|
@ -701,7 +699,7 @@ void CServerBrowser::Update()
|
|||
|
||||
// check if we need to resort
|
||||
// TODO: remove the str_comp
|
||||
if(m_Sorthash != SortHash() || m_DDRaceSorthash != DDRaceSortHash() || str_comp(m_aFilterString, g_Config.m_BrFilterString) != 0 || str_comp(m_aFilterGametypeString, g_Config.m_BrFilterGametype) != 0)
|
||||
if(m_Sorthash != SortHash() || str_comp(m_aFilterString, g_Config.m_BrFilterString) != 0 || str_comp(m_aFilterGametypeString, g_Config.m_BrFilterGametype) != 0)
|
||||
Sort();
|
||||
}
|
||||
|
||||
|
@ -820,8 +818,5 @@ int CServerBrowser::DDRaceSortHash() const
|
|||
i |= g_Config.m_BrFilterTestMap<<14;
|
||||
i |= g_Config.m_BrFilterTestServer<<15;
|
||||
return i;
|
||||
//TODO: DDRace Add these here after understanding how it works
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ static int aFontSizes[] = {8,9,10,11,12,13,14,15,16,17,18,19,20,36,64};
|
|||
|
||||
struct CFontChar
|
||||
{
|
||||
int m_Id;
|
||||
int m_ID;
|
||||
|
||||
// these values are scaled to the pFont size
|
||||
// width * font_size == real_size
|
||||
|
@ -244,10 +244,10 @@ class CTextRender : public IEngineTextRender
|
|||
}
|
||||
|
||||
|
||||
void UploadGlyph(CFontSizeData *pSizeData, int Texnum, int SlotId, int Chr, const void *pData)
|
||||
void UploadGlyph(CFontSizeData *pSizeData, int Texnum, int SlotID, int Chr, const void *pData)
|
||||
{
|
||||
int x = (SlotId%pSizeData->m_NumXChars) * (pSizeData->m_TextureWidth/pSizeData->m_NumXChars);
|
||||
int y = (SlotId/pSizeData->m_NumXChars) * (pSizeData->m_TextureHeight/pSizeData->m_NumYChars);
|
||||
int x = (SlotID%pSizeData->m_NumXChars) * (pSizeData->m_TextureWidth/pSizeData->m_NumXChars);
|
||||
int y = (SlotID/pSizeData->m_NumXChars) * (pSizeData->m_TextureHeight/pSizeData->m_NumYChars);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, pSizeData->m_aTextures[Texnum]);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y,
|
||||
|
@ -293,7 +293,7 @@ class CTextRender : public IEngineTextRender
|
|||
int RenderGlyph(CFont *pFont, CFontSizeData *pSizeData, int Chr)
|
||||
{
|
||||
FT_Bitmap *pBitmap;
|
||||
int SlotId = 0;
|
||||
int SlotID = 0;
|
||||
int SlotW = pSizeData->m_TextureWidth / pSizeData->m_NumXChars;
|
||||
int SlotH = pSizeData->m_TextureHeight / pSizeData->m_NumYChars;
|
||||
int SlotSize = SlotW*SlotH;
|
||||
|
@ -312,8 +312,8 @@ class CTextRender : public IEngineTextRender
|
|||
pBitmap = &pFont->m_FtFace->glyph->bitmap; // ignore_convention
|
||||
|
||||
// fetch slot
|
||||
SlotId = GetSlot(pSizeData);
|
||||
if(SlotId < 0)
|
||||
SlotID = GetSlot(pSizeData);
|
||||
if(SlotID < 0)
|
||||
return -1;
|
||||
|
||||
// adjust spacing
|
||||
|
@ -345,12 +345,12 @@ class CTextRender : public IEngineTextRender
|
|||
ms_aGlyphData[py*SlotW+px] = 255;
|
||||
|
||||
// upload the glyph
|
||||
UploadGlyph(pSizeData, 0, SlotId, Chr, ms_aGlyphData);
|
||||
UploadGlyph(pSizeData, 0, SlotID, Chr, ms_aGlyphData);
|
||||
|
||||
if(OutlineThickness == 1)
|
||||
{
|
||||
Grow(ms_aGlyphData, ms_aGlyphDataOutlined, SlotW, SlotH);
|
||||
UploadGlyph(pSizeData, 1, SlotId, Chr, ms_aGlyphDataOutlined);
|
||||
UploadGlyph(pSizeData, 1, SlotID, Chr, ms_aGlyphDataOutlined);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -359,32 +359,32 @@ class CTextRender : public IEngineTextRender
|
|||
Grow(ms_aGlyphData, ms_aGlyphDataOutlined, SlotW, SlotH);
|
||||
Grow(ms_aGlyphDataOutlined, ms_aGlyphData, SlotW, SlotH);
|
||||
}
|
||||
UploadGlyph(pSizeData, 1, SlotId, Chr, ms_aGlyphData);
|
||||
UploadGlyph(pSizeData, 1, SlotID, Chr, ms_aGlyphData);
|
||||
}
|
||||
|
||||
// set char info
|
||||
{
|
||||
CFontChar *pFontchr = &pSizeData->m_aCharacters[SlotId];
|
||||
CFontChar *pFontchr = &pSizeData->m_aCharacters[SlotID];
|
||||
float Scale = 1.0f/pSizeData->m_FontSize;
|
||||
float Uscale = 1.0f/pSizeData->m_TextureWidth;
|
||||
float Vscale = 1.0f/pSizeData->m_TextureHeight;
|
||||
int Height = pBitmap->rows + OutlineThickness*2 + 2; // ignore_convention
|
||||
int Width = pBitmap->width + OutlineThickness*2 + 2; // ignore_convention
|
||||
|
||||
pFontchr->m_Id = Chr;
|
||||
pFontchr->m_ID = Chr;
|
||||
pFontchr->m_Height = Height * Scale;
|
||||
pFontchr->m_Width = Width * Scale;
|
||||
pFontchr->m_OffsetX = (pFont->m_FtFace->glyph->bitmap_left-1) * Scale; // ignore_convention
|
||||
pFontchr->m_OffsetY = (pSizeData->m_FontSize - pFont->m_FtFace->glyph->bitmap_top) * Scale; // ignore_convention
|
||||
pFontchr->m_AdvanceX = (pFont->m_FtFace->glyph->advance.x>>6) * Scale; // ignore_convention
|
||||
|
||||
pFontchr->m_aUvs[0] = (SlotId%pSizeData->m_NumXChars) / (float)(pSizeData->m_NumXChars);
|
||||
pFontchr->m_aUvs[1] = (SlotId/pSizeData->m_NumXChars) / (float)(pSizeData->m_NumYChars);
|
||||
pFontchr->m_aUvs[0] = (SlotID%pSizeData->m_NumXChars) / (float)(pSizeData->m_NumXChars);
|
||||
pFontchr->m_aUvs[1] = (SlotID/pSizeData->m_NumXChars) / (float)(pSizeData->m_NumYChars);
|
||||
pFontchr->m_aUvs[2] = pFontchr->m_aUvs[0] + Width*Uscale;
|
||||
pFontchr->m_aUvs[3] = pFontchr->m_aUvs[1] + Height*Vscale;
|
||||
}
|
||||
|
||||
return SlotId;
|
||||
return SlotID;
|
||||
}
|
||||
|
||||
CFontChar *GetChar(CFont *pFont, CFontSizeData *pSizeData, int Chr)
|
||||
|
@ -396,7 +396,7 @@ class CTextRender : public IEngineTextRender
|
|||
int i;
|
||||
for(i = 0; i < pSizeData->m_CurrentCharacter; i++)
|
||||
{
|
||||
if(pSizeData->m_aCharacters[i].m_Id == Chr)
|
||||
if(pSizeData->m_aCharacters[i].m_ID == Chr)
|
||||
{
|
||||
pFontchr = &pSizeData->m_aCharacters[i];
|
||||
break;
|
||||
|
|
|
@ -45,12 +45,12 @@ public:
|
|||
|
||||
typedef void (*FPrintCallback)(const char *pStr, void *pUser);
|
||||
typedef void (*FPossibleCallback)(const char *pCmd, void *pUser);
|
||||
typedef void (*FCommandCallback)(IResult *pResult, void *pUserData, int ClientId);
|
||||
typedef void (*FCommandCallback)(IResult *pResult, void *pUserData, int ClientID);
|
||||
typedef void (*FChainCommandCallback)(IResult *pResult, void *pUserData, FCommandCallback pfnCallback, void *pCallbackUserData);
|
||||
|
||||
|
||||
typedef bool (*FCompareClientsCallback)(int ClientLevel, int Victim, void *pUserData);
|
||||
typedef bool (*FClientOnlineCallback)(int ClientId, void *pUserData);
|
||||
|
||||
typedef bool (*FClientOnlineCallback)(int ClientID, void *pUserData);
|
||||
|
||||
virtual CCommandInfo *GetCommandInfo(const char *pName, int FlagMask) = 0;
|
||||
virtual void PossibleCommands(const char *pStr, int FlagMask, FPossibleCallback pfnCallback, void *pUser) = 0;
|
||||
virtual void ParseArguments(int NumArgs, const char **ppArguments) = 0;
|
||||
|
@ -59,11 +59,11 @@ public:
|
|||
int Flags, FCommandCallback pfnFunc, void *pUser, const char *pHelp, const int Level) = 0;
|
||||
virtual void List(const int Level, int Flags) = 0;
|
||||
virtual void Chain(const char *pName, FChainCommandCallback pfnChainFunc, void *pUser) = 0;
|
||||
virtual void StoreCommands(bool Store, int ClientId) = 0;
|
||||
virtual void StoreCommands(bool Store, int ClientID) = 0;
|
||||
|
||||
virtual bool LineIsValid(const char *pStr) = 0;
|
||||
virtual void ExecuteLine(const char *Sptr, const int ClientLevel, const int ClientId, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0) = 0;
|
||||
virtual void ExecuteLineStroked(int Stroke, const char *pStr, const int ClientLevel, const int ClientId, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0) = 0;
|
||||
virtual void ExecuteLine(const char *Sptr, const int ClientLevel, const int ClientID, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0) = 0;
|
||||
virtual void ExecuteLineStroked(int Stroke, const char *pStr, const int ClientLevel, const int ClientID, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0) = 0;
|
||||
virtual void ExecuteFile(const char *pFilename, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0, int Level = 3) = 0;
|
||||
|
||||
virtual void RegisterPrintCallback(FPrintCallback pfnPrintCallback, void *pUserData) = 0;
|
||||
|
|
|
@ -12,9 +12,9 @@ public:
|
|||
virtual void *GetData(int Index) = 0;
|
||||
virtual void *GetDataSwapped(int Index) = 0;
|
||||
virtual void UnloadData(int Index) = 0;
|
||||
virtual void *GetItem(int Index, int *Type, int *pId) = 0;
|
||||
virtual void *GetItem(int Index, int *Type, int *pID) = 0;
|
||||
virtual void GetType(int Type, int *pStart, int *pNum) = 0;
|
||||
virtual void *FindItem(int Type, int Id) = 0;
|
||||
virtual void *FindItem(int Type, int ID) = 0;
|
||||
virtual int NumItems() = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
virtual void GetClientIP(int ClientID, char *pIPString, int Size) = 0;
|
||||
virtual int *LatestInput(int ClientID, int *pSize) = 0;
|
||||
|
||||
virtual void SetRconLevel(int ClientId, int Level) = 0;
|
||||
virtual void SetRconLevel(int ClientID, int Level) = 0;
|
||||
|
||||
virtual int SendMsg(CMsgPacker *pMsg, int Flags, int ClientID) = 0;
|
||||
|
||||
|
@ -51,7 +51,7 @@ public:
|
|||
|
||||
virtual int SnapNewID() = 0;
|
||||
virtual void SnapFreeID(int ID) = 0;
|
||||
virtual void *SnapNewItem(int Type, int Id, int Size) = 0;
|
||||
virtual void *SnapNewItem(int Type, int ID, int Size) = 0;
|
||||
|
||||
virtual void SnapSetStaticsize(int ItemType, int Size) = 0;
|
||||
|
||||
|
@ -73,7 +73,7 @@ public:
|
|||
virtual void OnSnap(int ClientID) = 0;
|
||||
virtual void OnPostSnap() = 0;
|
||||
|
||||
virtual void OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientID) = 0;
|
||||
virtual void OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID) = 0;
|
||||
|
||||
virtual void OnClientConnected(int ClientID) = 0;
|
||||
virtual void OnClientEnter(int ClientID) = 0;
|
||||
|
@ -81,13 +81,15 @@ public:
|
|||
virtual void OnClientDirectInput(int ClientID, void *pInput) = 0;
|
||||
virtual void OnClientPredictedInput(int ClientID, void *pInput) = 0;
|
||||
|
||||
virtual void OnSetAuthed(int ClientId,int Level) = 0;
|
||||
virtual const char *Version() = 0;
|
||||
virtual const char *NetVersion() = 0;
|
||||
|
||||
//DDRace
|
||||
|
||||
virtual void OnSetAuthed(int ClientID,int Level) = 0;
|
||||
|
||||
virtual bool PlayerCollision() = 0;
|
||||
virtual bool PlayerHooking() = 0;
|
||||
|
||||
virtual const char *Version() = 0;
|
||||
virtual const char *NetVersion() = 0;
|
||||
};
|
||||
|
||||
extern IGameServer *CreateGameServer();
|
||||
|
|
|
@ -121,15 +121,15 @@ int CSnapIDPool::NewID()
|
|||
while(m_FirstTimed != -1 && m_aIDs[m_FirstTimed].m_Timeout < Now)
|
||||
RemoveFirstTimeout();
|
||||
|
||||
int Id = m_FirstFree;
|
||||
dbg_assert(Id != -1, "id error");
|
||||
if(Id == -1)
|
||||
return Id;
|
||||
int ID = m_FirstFree;
|
||||
dbg_assert(ID != -1, "id error");
|
||||
if(ID == -1)
|
||||
return ID;
|
||||
m_FirstFree = m_aIDs[m_FirstFree].m_Next;
|
||||
m_aIDs[Id].m_State = 1;
|
||||
m_aIDs[ID].m_State = 1;
|
||||
m_Usage++;
|
||||
m_InUsage++;
|
||||
return Id;
|
||||
return ID;
|
||||
}
|
||||
|
||||
void CSnapIDPool::TimeoutIDs()
|
||||
|
@ -139,26 +139,26 @@ void CSnapIDPool::TimeoutIDs()
|
|||
RemoveFirstTimeout();
|
||||
}
|
||||
|
||||
void CSnapIDPool::FreeID(int Id)
|
||||
void CSnapIDPool::FreeID(int ID)
|
||||
{
|
||||
if(Id < 0)
|
||||
if(ID < 0)
|
||||
return;
|
||||
dbg_assert(m_aIDs[Id].m_State == 1, "id is not alloced");
|
||||
dbg_assert(m_aIDs[ID].m_State == 1, "id is not alloced");
|
||||
|
||||
m_InUsage--;
|
||||
m_aIDs[Id].m_State = 2;
|
||||
m_aIDs[Id].m_Timeout = time_get()+time_freq()*5;
|
||||
m_aIDs[Id].m_Next = -1;
|
||||
m_aIDs[ID].m_State = 2;
|
||||
m_aIDs[ID].m_Timeout = time_get()+time_freq()*5;
|
||||
m_aIDs[ID].m_Next = -1;
|
||||
|
||||
if(m_LastTimed != -1)
|
||||
{
|
||||
m_aIDs[m_LastTimed].m_Next = Id;
|
||||
m_LastTimed = Id;
|
||||
m_aIDs[m_LastTimed].m_Next = ID;
|
||||
m_LastTimed = ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_FirstTimed = Id;
|
||||
m_LastTimed = Id;
|
||||
m_FirstTimed = ID;
|
||||
m_LastTimed = ID;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,7 @@ CServer::CServer() : m_DemoRecorder(&m_SnapshotDelta)
|
|||
|
||||
memset(m_aPrevStates, CClient::STATE_EMPTY, MAX_CLIENTS * sizeof(int));
|
||||
|
||||
m_RconClientId = -1;
|
||||
m_RconClientID = -1;
|
||||
|
||||
Init();
|
||||
}
|
||||
|
@ -209,7 +209,6 @@ int CServer::TrySetClientName(int ClientID, const char *pName)
|
|||
// trim the name
|
||||
str_copy(aTrimmedName, StrLtrim(pName), sizeof(aTrimmedName));
|
||||
StrRtrim(aTrimmedName);
|
||||
//TODO: See if this still needs commenting
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), "'%s' -> '%s'", pName, aTrimmedName);
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBuf);
|
||||
|
@ -281,7 +280,7 @@ void CServer::Kick(int ClientID, const char *pReason)
|
|||
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", "invalid client id to kick");
|
||||
return;
|
||||
}
|
||||
else if(m_RconClientId == ClientID)
|
||||
else if(m_RconClientID == ClientID)
|
||||
{
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", "you can't kick yourself");
|
||||
return;
|
||||
|
@ -350,28 +349,20 @@ void CServer::GetClientIP(int ClientID, char *pIPString, int Size)
|
|||
}
|
||||
|
||||
|
||||
void CServer::SetClientAuthed(int ClientID, int Level) {
|
||||
if(ClientID < 0 || ClientID >= MAX_CLIENTS || m_aClients[ClientID].m_State == CClient::STATE_READY)
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_aClients[ClientID].m_Authed = Level;
|
||||
}
|
||||
|
||||
int *CServer::LatestInput(int ClientId, int *size)
|
||||
int *CServer::LatestInput(int ClientID, int *size)
|
||||
{
|
||||
if(ClientId < 0 || ClientId >= MAX_CLIENTS || m_aClients[ClientId].m_State < CServer::CClient::STATE_READY)
|
||||
if(ClientID < 0 || ClientID >= MAX_CLIENTS || m_aClients[ClientID].m_State < CServer::CClient::STATE_READY)
|
||||
return 0;
|
||||
return m_aClients[ClientId].m_LatestInput.m_aData;
|
||||
return m_aClients[ClientID].m_LatestInput.m_aData;
|
||||
}
|
||||
|
||||
const char *CServer::ClientName(int ClientId)
|
||||
const char *CServer::ClientName(int ClientID)
|
||||
{
|
||||
if(ClientId < 0 || ClientId >= MAX_CLIENTS || m_aClients[ClientId].m_State == CServer::CClient::STATE_EMPTY)
|
||||
if(ClientID < 0 || ClientID >= MAX_CLIENTS || m_aClients[ClientID].m_State == CServer::CClient::STATE_EMPTY)
|
||||
return "(invalid client)";
|
||||
else if(m_aClients[ClientId].m_State < CServer::CClient::STATE_READY)
|
||||
else if(m_aClients[ClientID].m_State < CServer::CClient::STATE_READY)
|
||||
return "(connecting client)";
|
||||
return m_aClients[ClientId].m_aName;
|
||||
return m_aClients[ClientID].m_aName;
|
||||
}
|
||||
|
||||
bool CServer::ClientIngame(int ClientID)
|
||||
|
@ -379,9 +370,9 @@ bool CServer::ClientIngame(int ClientID)
|
|||
return ClientID >= 0 && ClientID < MAX_CLIENTS && m_aClients[ClientID].m_State == CServer::CClient::STATE_INGAME;
|
||||
}
|
||||
|
||||
int CServer::SendMsg(CMsgPacker *pMsg, int Flags, int ClientId)
|
||||
int CServer::SendMsg(CMsgPacker *pMsg, int Flags, int ClientID)
|
||||
{
|
||||
return SendMsgEx(pMsg, Flags, ClientId, false);
|
||||
return SendMsgEx(pMsg, Flags, ClientID, false);
|
||||
}
|
||||
|
||||
int CServer::SendMsgEx(CMsgPacker *pMsg, int Flags, int ClientID, bool System)
|
||||
|
@ -562,60 +553,60 @@ void CServer::DoSnapshot()
|
|||
}
|
||||
|
||||
|
||||
int CServer::NewClientCallback(int ClientId, void *pUser)
|
||||
int CServer::NewClientCallback(int ClientID, void *pUser)
|
||||
{
|
||||
CServer *pThis = (CServer *)pUser;
|
||||
pThis->m_aClients[ClientId].m_State = CClient::STATE_AUTH;
|
||||
pThis->m_aClients[ClientId].m_aName[0] = 0;
|
||||
pThis->m_aClients[ClientId].m_aClan[0] = 0;
|
||||
pThis->m_aClients[ClientId].m_Authed = 0;
|
||||
pThis->m_aClients[ClientId].m_AuthTries = 0;
|
||||
memset(&pThis->m_aClients[ClientId].m_Addr, 0, sizeof(NETADDR));
|
||||
pThis->m_aClients[ClientId].Reset();
|
||||
pThis->m_aClients[ClientID].m_State = CClient::STATE_AUTH;
|
||||
pThis->m_aClients[ClientID].m_aName[0] = 0;
|
||||
pThis->m_aClients[ClientID].m_aClan[0] = 0;
|
||||
pThis->m_aClients[ClientID].m_Authed = 0;
|
||||
pThis->m_aClients[ClientID].m_AuthTries = 0;
|
||||
memset(&pThis->m_aClients[ClientID].m_Addr, 0, sizeof(NETADDR));
|
||||
pThis->m_aClients[ClientID].Reset();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CServer::DelClientCallback(int ClientId, const char *pReason, void *pUser)
|
||||
int CServer::DelClientCallback(int ClientID, const char *pReason, void *pUser)
|
||||
{
|
||||
CServer *pThis = (CServer *)pUser;
|
||||
|
||||
NETADDR Addr = pThis->m_NetServer.ClientAddr(ClientId);
|
||||
NETADDR Addr = pThis->m_NetServer.ClientAddr(ClientID);
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), "client dropped. cid=%d ip=%d.%d.%d.%d reason=\"%s\"",
|
||||
ClientId,
|
||||
ClientID,
|
||||
Addr.ip[0], Addr.ip[1], Addr.ip[2], Addr.ip[3],
|
||||
pReason
|
||||
);
|
||||
pThis->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBuf);
|
||||
|
||||
// notify the mod about the drop
|
||||
if(pThis->m_aClients[ClientId].m_State >= CClient::STATE_READY)
|
||||
pThis->GameServer()->OnClientDrop(ClientId);
|
||||
if(pThis->m_aClients[ClientID].m_State >= CClient::STATE_READY)
|
||||
pThis->GameServer()->OnClientDrop(ClientID);
|
||||
|
||||
pThis->m_aClients[ClientId].m_State = CClient::STATE_EMPTY;
|
||||
pThis->m_aClients[ClientId].m_aName[0] = 0;
|
||||
pThis->m_aClients[ClientId].m_aClan[0] = 0;
|
||||
pThis->m_aClients[ClientId].m_Authed = 0;
|
||||
pThis->m_aClients[ClientId].m_AuthTries = 0;
|
||||
pThis->m_aPrevStates[ClientId] = CClient::STATE_EMPTY;
|
||||
memset(&pThis->m_aClients[ClientId].m_Addr, 0, sizeof(NETADDR));
|
||||
pThis->m_aClients[ClientId].m_Snapshots.PurgeAll();
|
||||
pThis->m_aClients[ClientID].m_State = CClient::STATE_EMPTY;
|
||||
pThis->m_aClients[ClientID].m_aName[0] = 0;
|
||||
pThis->m_aClients[ClientID].m_aClan[0] = 0;
|
||||
pThis->m_aClients[ClientID].m_Authed = 0;
|
||||
pThis->m_aClients[ClientID].m_AuthTries = 0;
|
||||
pThis->m_aPrevStates[ClientID] = CClient::STATE_EMPTY;
|
||||
memset(&pThis->m_aClients[ClientID].m_Addr, 0, sizeof(NETADDR));
|
||||
pThis->m_aClients[ClientID].m_Snapshots.PurgeAll();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CServer::SendMap(int ClientId)
|
||||
void CServer::SendMap(int ClientID)
|
||||
{
|
||||
CMsgPacker Msg(NETMSG_MAP_CHANGE);
|
||||
Msg.AddString(GetMapName(), 0);
|
||||
Msg.AddInt(m_CurrentMapCrc);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL|MSGFLAG_FLUSH, ClientId, true);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL|MSGFLAG_FLUSH, ClientID, true);
|
||||
}
|
||||
|
||||
void CServer::SendRconLine(int ClientId, const char *pLine)
|
||||
void CServer::SendRconLine(int ClientID, const char *pLine)
|
||||
{
|
||||
CMsgPacker Msg(NETMSG_RCON_LINE);
|
||||
Msg.AddString(pLine, 512);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL, ClientId, true);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL, ClientID, true);
|
||||
}
|
||||
|
||||
void CServer::SendRconLineAuthed(const char *pLine, void *pUser)
|
||||
|
@ -636,26 +627,9 @@ void CServer::SendRconLineAuthed(const char *pLine, void *pUser)
|
|||
ReentryGuard--;
|
||||
}
|
||||
|
||||
void CServer::SendRconResponse(const char *pLine, void *pUser)
|
||||
{
|
||||
RconResponseInfo *pInfo = (RconResponseInfo *)pUser;
|
||||
CServer *pThis = pInfo->m_Server;
|
||||
static volatile int ReentryGuard = 0;
|
||||
|
||||
if(ReentryGuard)
|
||||
return;
|
||||
|
||||
ReentryGuard++;
|
||||
|
||||
if(pThis->m_aClients[pInfo->m_ClientId].m_State != CClient::STATE_EMPTY)
|
||||
pThis->SendRconLine(pInfo->m_ClientId, pLine);
|
||||
|
||||
ReentryGuard--;
|
||||
}
|
||||
|
||||
void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
||||
{
|
||||
int ClientId = pPacket->m_ClientID;
|
||||
int ClientID = pPacket->m_ClientID;
|
||||
NETADDR Addr;
|
||||
CUnpacker Unpacker;
|
||||
Unpacker.Reset(pPacket->m_pData, pPacket->m_DataSize);
|
||||
|
@ -668,7 +642,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
|||
if(Unpacker.Error())
|
||||
return;
|
||||
|
||||
if(m_aClients[ClientId].m_State == CClient::STATE_AUTH)
|
||||
if(m_aClients[ClientID].m_State == CClient::STATE_AUTH)
|
||||
{
|
||||
if(Sys && Msg == NETMSG_INFO)
|
||||
{
|
||||
|
@ -680,30 +654,30 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
|||
// OH FUCK! wrong version, drop him
|
||||
char aReason[256];
|
||||
str_format(aReason, sizeof(aReason), "Wrong version. Server is running '%s' and client '%s'", GameServer()->NetVersion(), aVersion);
|
||||
m_NetServer.Drop(ClientId, aReason);
|
||||
m_NetServer.Drop(ClientID, aReason);
|
||||
return;
|
||||
}
|
||||
|
||||
str_copy(m_aClients[ClientId].m_aName, Unpacker.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), MAX_NAME_LENGTH);
|
||||
str_copy(m_aClients[ClientId].m_aClan, Unpacker.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), MAX_CLANNAME_LENGTH);
|
||||
str_copy(m_aClients[ClientID].m_aName, Unpacker.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), MAX_NAME_LENGTH);
|
||||
str_copy(m_aClients[ClientID].m_aClan, Unpacker.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), MAX_CLANNAME_LENGTH);
|
||||
pPassword = Unpacker.GetString(CUnpacker::SANITIZE_CC);
|
||||
|
||||
if(g_Config.m_Password[0] != 0 && str_comp(g_Config.m_Password, pPassword) != 0)
|
||||
{
|
||||
// wrong password
|
||||
m_NetServer.Drop(ClientId, "Wrong password");
|
||||
m_NetServer.Drop(ClientID, "Wrong password");
|
||||
return;
|
||||
}
|
||||
|
||||
// reserved slot
|
||||
if(ClientId >= (g_Config.m_SvMaxClients-g_Config.m_SvReservedSlots) && g_Config.m_SvReservedSlotsPass[0] != 0 && strcmp(g_Config.m_SvReservedSlotsPass, pPassword) != 0)
|
||||
if(ClientID >= (g_Config.m_SvMaxClients-g_Config.m_SvReservedSlots) && g_Config.m_SvReservedSlotsPass[0] != 0 && strcmp(g_Config.m_SvReservedSlotsPass, pPassword) != 0)
|
||||
{
|
||||
m_NetServer.Drop(ClientId, "This server is full");
|
||||
m_NetServer.Drop(ClientID, "This server is full");
|
||||
return;
|
||||
}
|
||||
|
||||
m_aClients[ClientId].m_State = CClient::STATE_CONNECTING;
|
||||
SendMap(ClientId);
|
||||
m_aClients[ClientID].m_State = CClient::STATE_CONNECTING;
|
||||
SendMap(ClientID);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -735,7 +709,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
|||
Msg.AddInt(m_CurrentMapSize);
|
||||
Msg.AddInt(ChunkSize);
|
||||
Msg.AddRaw(&m_pCurrentMapData[Offset], ChunkSize);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL|MSGFLAG_FLUSH, ClientId, true);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL|MSGFLAG_FLUSH, ClientID, true);
|
||||
|
||||
if(g_Config.m_Debug)
|
||||
{
|
||||
|
@ -746,31 +720,31 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
|||
}
|
||||
else if(Msg == NETMSG_READY)
|
||||
{
|
||||
if(m_aClients[ClientId].m_State == CClient::STATE_CONNECTING)
|
||||
if(m_aClients[ClientID].m_State == CClient::STATE_CONNECTING)
|
||||
{
|
||||
Addr = m_NetServer.ClientAddr(ClientId);
|
||||
Addr = m_NetServer.ClientAddr(ClientID);
|
||||
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), "player is ready. ClientId=%x ip=%d.%d.%d.%d",
|
||||
ClientId, Addr.ip[0], Addr.ip[1], Addr.ip[2], Addr.ip[3]);
|
||||
str_format(aBuf, sizeof(aBuf), "player is ready. ClientID=%x ip=%d.%d.%d.%d",
|
||||
ClientID, Addr.ip[0], Addr.ip[1], Addr.ip[2], Addr.ip[3]);
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBuf);
|
||||
m_aClients[ClientId].m_State = CClient::STATE_READY;
|
||||
GameServer()->OnClientConnected(ClientId);
|
||||
GameServer()->OnSetAuthed(ClientId, m_aClients[ClientId].m_Authed);
|
||||
m_aClients[ClientID].m_State = CClient::STATE_READY;
|
||||
GameServer()->OnClientConnected(ClientID);
|
||||
GameServer()->OnSetAuthed(ClientID, m_aClients[ClientID].m_Authed);
|
||||
}
|
||||
}
|
||||
else if(Msg == NETMSG_ENTERGAME)
|
||||
{
|
||||
if(m_aClients[ClientId].m_State == CClient::STATE_READY)
|
||||
if(m_aClients[ClientID].m_State == CClient::STATE_READY)
|
||||
{
|
||||
Addr = m_NetServer.ClientAddr(ClientId);
|
||||
m_aClients[ClientId].m_Addr = Addr;
|
||||
Addr = m_NetServer.ClientAddr(ClientID);
|
||||
m_aClients[ClientID].m_Addr = Addr;
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), "player has entered the game. ClientId=%x ip=%d.%d.%d.%d",
|
||||
ClientId, Addr.ip[0], Addr.ip[1], Addr.ip[2], Addr.ip[3]);
|
||||
str_format(aBuf, sizeof(aBuf), "player has entered the game. ClientID=%x ip=%d.%d.%d.%d",
|
||||
ClientID, Addr.ip[0], Addr.ip[1], Addr.ip[2], Addr.ip[3]);
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf);
|
||||
m_aClients[ClientId].m_State = CClient::STATE_INGAME;
|
||||
GameServer()->OnClientEnter(ClientId);
|
||||
m_aClients[ClientID].m_State = CClient::STATE_INGAME;
|
||||
GameServer()->OnClientEnter(ClientID);
|
||||
}
|
||||
}
|
||||
else if(Msg == NETMSG_INPUT)
|
||||
|
@ -778,7 +752,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
|||
CClient::CInput *pInput;
|
||||
int64 TagTime;
|
||||
|
||||
m_aClients[ClientId].m_LastAckedSnapshot = Unpacker.GetInt();
|
||||
m_aClients[ClientID].m_LastAckedSnapshot = Unpacker.GetInt();
|
||||
int IntendedTick = Unpacker.GetInt();
|
||||
int Size = Unpacker.GetInt();
|
||||
|
||||
|
@ -786,27 +760,27 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
|||
if(Unpacker.Error() || Size/4 > MAX_INPUT_SIZE)
|
||||
return;
|
||||
|
||||
if(m_aClients[ClientId].m_LastAckedSnapshot > 0)
|
||||
m_aClients[ClientId].m_SnapRate = CClient::SNAPRATE_FULL;
|
||||
if(m_aClients[ClientID].m_LastAckedSnapshot > 0)
|
||||
m_aClients[ClientID].m_SnapRate = CClient::SNAPRATE_FULL;
|
||||
|
||||
if(m_aClients[ClientId].m_Snapshots.Get(m_aClients[ClientId].m_LastAckedSnapshot, &TagTime, 0, 0) >= 0)
|
||||
m_aClients[ClientId].m_Latency = (int)(((time_get()-TagTime)*1000)/time_freq());
|
||||
if(m_aClients[ClientID].m_Snapshots.Get(m_aClients[ClientID].m_LastAckedSnapshot, &TagTime, 0, 0) >= 0)
|
||||
m_aClients[ClientID].m_Latency = (int)(((time_get()-TagTime)*1000)/time_freq());
|
||||
|
||||
// add message to report the input timing
|
||||
// skip packets that are old
|
||||
if(IntendedTick > m_aClients[ClientId].m_LastInputTick)
|
||||
if(IntendedTick > m_aClients[ClientID].m_LastInputTick)
|
||||
{
|
||||
int TimeLeft = ((TickStartTime(IntendedTick)-time_get())*1000) / time_freq();
|
||||
|
||||
CMsgPacker Msg(NETMSG_INPUTTIMING);
|
||||
Msg.AddInt(IntendedTick);
|
||||
Msg.AddInt(TimeLeft);
|
||||
SendMsgEx(&Msg, 0, ClientId, true);
|
||||
SendMsgEx(&Msg, 0, ClientID, true);
|
||||
}
|
||||
|
||||
m_aClients[ClientId].m_LastInputTick = IntendedTick;
|
||||
m_aClients[ClientID].m_LastInputTick = IntendedTick;
|
||||
|
||||
pInput = &m_aClients[ClientId].m_aInputs[m_aClients[ClientId].m_CurrentInput];
|
||||
pInput = &m_aClients[ClientID].m_aInputs[m_aClients[ClientID].m_CurrentInput];
|
||||
|
||||
if(IntendedTick <= Tick())
|
||||
IntendedTick = Tick()+1;
|
||||
|
@ -816,40 +790,40 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
|||
for(int i = 0; i < Size/4; i++)
|
||||
pInput->m_aData[i] = Unpacker.GetInt();
|
||||
|
||||
mem_copy(m_aClients[ClientId].m_LatestInput.m_aData, pInput->m_aData, MAX_INPUT_SIZE*sizeof(int));
|
||||
mem_copy(m_aClients[ClientID].m_LatestInput.m_aData, pInput->m_aData, MAX_INPUT_SIZE*sizeof(int));
|
||||
|
||||
m_aClients[ClientId].m_CurrentInput++;
|
||||
m_aClients[ClientId].m_CurrentInput %= 200;
|
||||
m_aClients[ClientID].m_CurrentInput++;
|
||||
m_aClients[ClientID].m_CurrentInput %= 200;
|
||||
|
||||
// call the mod with the fresh input data
|
||||
if(m_aClients[ClientId].m_State == CClient::STATE_INGAME)
|
||||
GameServer()->OnClientDirectInput(ClientId, m_aClients[ClientId].m_LatestInput.m_aData);
|
||||
if(m_aClients[ClientID].m_State == CClient::STATE_INGAME)
|
||||
GameServer()->OnClientDirectInput(ClientID, m_aClients[ClientID].m_LatestInput.m_aData);
|
||||
}
|
||||
else if(Msg == NETMSG_RCON_CMD)
|
||||
{
|
||||
const char *pCmd = Unpacker.GetString();
|
||||
|
||||
if(Unpacker.Error() == 0/* && m_aClients[ClientId].m_Authed*/)
|
||||
if(Unpacker.Error() == 0/* && m_aClients[ClientID].m_Authed*/)
|
||||
{
|
||||
|
||||
char aBuf[256];
|
||||
if(m_aClients[ClientId].m_Authed >= 0)
|
||||
if(m_aClients[ClientID].m_Authed >= 0)
|
||||
{
|
||||
Console()->RegisterAlternativePrintCallback(0, 0);
|
||||
|
||||
str_format(aBuf, sizeof(aBuf), "'%s' ClientId=%d Level=%d Rcon='%s'", ClientName(ClientId), ClientId, m_aClients[ClientId].m_Authed, pCmd);
|
||||
str_format(aBuf, sizeof(aBuf), "'%s' ClientID=%d Level=%d Rcon='%s'", ClientName(ClientID), ClientID, m_aClients[ClientID].m_Authed, pCmd);
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBuf);
|
||||
|
||||
Console()->ReleaseAlternativePrintCallback();
|
||||
|
||||
m_RconClientId = ClientId;
|
||||
m_RconClientID = ClientID;
|
||||
|
||||
RconResponseInfo Info;
|
||||
Info.m_Server = this;
|
||||
Info.m_ClientId = ClientId;
|
||||
Info.m_ClientID = ClientID;
|
||||
|
||||
Console()->ExecuteLine(pCmd, m_aClients[ClientId].m_Authed, ClientId, SendRconLineAuthed, this, SendRconResponse, &Info);
|
||||
m_RconClientId = -1;
|
||||
Console()->ExecuteLine(pCmd, m_aClients[ClientID].m_Authed, ClientID, SendRconLineAuthed, this, SendRconResponse, &Info);
|
||||
m_RconClientID = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -860,53 +834,53 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
|||
pPw = Unpacker.GetString(CUnpacker::SANITIZE_CC);
|
||||
|
||||
if(Unpacker.Error() == 0)
|
||||
CheckPass(ClientId,pPw);
|
||||
CheckPass(ClientID,pPw);
|
||||
|
||||
/*if(Unpacker.Error() == 0)
|
||||
{
|
||||
if(g_Config.m_SvRconPassword[0] == 0)
|
||||
{
|
||||
SendRconLine(ClientId, "No rcon password set on server. Set sv_rcon_password to enable the remote console.");
|
||||
SendRconLine(ClientID, "No rcon password set on server. Set sv_rcon_password to enable the remote console.");
|
||||
}
|
||||
else if(str_comp(pPw, g_Config.m_SvRconPassword) == 0)
|
||||
{
|
||||
CMsgPacker Msg(NETMSG_RCON_AUTH_STATUS);
|
||||
Msg.AddInt(1);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL, ClientId, true);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL, ClientID, true);
|
||||
|
||||
m_aClients[ClientId].m_Authed = 1;
|
||||
SendRconLine(ClientId, "Authentication successful. Remote console access granted.");
|
||||
m_aClients[ClientID].m_Authed = 1;
|
||||
SendRconLine(ClientID, "Authentication successful. Remote console access granted.");
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), "ClientId=%d authed", ClientId);
|
||||
str_format(aBuf, sizeof(aBuf), "ClientID=%d authed", ClientID);
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf);
|
||||
}
|
||||
else if(g_Config.m_SvRconMaxTries)
|
||||
{
|
||||
m_aClients[ClientId].m_AuthTries++;
|
||||
m_aClients[ClientID].m_AuthTries++;
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof(aBuf), "Wrong password %d/%d.", m_aClients[ClientId].m_AuthTries, g_Config.m_SvRconMaxTries);
|
||||
SendRconLine(ClientId, aBuf);
|
||||
if(m_aClients[ClientId].m_AuthTries >= g_Config.m_SvRconMaxTries)
|
||||
str_format(aBuf, sizeof(aBuf), "Wrong password %d/%d.", m_aClients[ClientID].m_AuthTries, g_Config.m_SvRconMaxTries);
|
||||
SendRconLine(ClientID, aBuf);
|
||||
if(m_aClients[ClientID].m_AuthTries >= g_Config.m_SvRconMaxTries)
|
||||
{
|
||||
if(!g_Config.m_SvRconBantime)
|
||||
m_NetServer.Drop(ClientId, "Too many remote console authentication tries");
|
||||
m_NetServer.Drop(ClientID, "Too many remote console authentication tries");
|
||||
else
|
||||
{
|
||||
NETADDR Addr = m_NetServer.ClientAddr(ClientId);
|
||||
NETADDR Addr = m_NetServer.ClientAddr(ClientID);
|
||||
BanAdd(Addr, g_Config.m_SvRconBantime*60, "Too many remote console authentication tries");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SendRconLine(ClientId, "Wrong password.");
|
||||
SendRconLine(ClientID, "Wrong password.");
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else if(Msg == NETMSG_PING)
|
||||
{
|
||||
CMsgPacker Msg(NETMSG_PING_REPLY);
|
||||
SendMsgEx(&Msg, 0, ClientId, true);
|
||||
SendMsgEx(&Msg, 0, ClientID, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -924,7 +898,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
|||
}
|
||||
|
||||
char aBufMsg[256];
|
||||
str_format(aBufMsg, sizeof(aBufMsg), "strange message ClientId=%d msg=%d data_size=%d", ClientId, Msg, pPacket->m_DataSize);
|
||||
str_format(aBufMsg, sizeof(aBufMsg), "strange message ClientID=%d msg=%d data_size=%d", ClientID, Msg, pPacket->m_DataSize);
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "server", aBufMsg);
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "server", aBuf);
|
||||
}
|
||||
|
@ -933,8 +907,8 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
|||
else
|
||||
{
|
||||
// game message
|
||||
if(m_aClients[ClientId].m_State >= CClient::STATE_READY)
|
||||
GameServer()->OnMessage(Msg, &Unpacker, ClientId);
|
||||
if(m_aClients[ClientID].m_State >= CClient::STATE_READY)
|
||||
GameServer()->OnMessage(Msg, &Unpacker, ClientID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1245,9 +1219,9 @@ int CServer::Run()
|
|||
}
|
||||
|
||||
m_NetServer.SetCallbacks(NewClientCallback, DelClientCallback, this);
|
||||
|
||||
|
||||
Console()->ExecuteFile(SERVER_BANMASTERFILE, 0, 0, 0, 0, 4);
|
||||
|
||||
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), "server name is '%s'", g_Config.m_SvName);
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf);
|
||||
|
@ -1404,7 +1378,7 @@ int CServer::Run()
|
|||
return 0;
|
||||
}
|
||||
|
||||
void CServer::ConKick(IConsole::IResult *pResult, void *pUser, int ClientId)
|
||||
void CServer::ConKick(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||
{
|
||||
int Victim = pResult->GetVictim();
|
||||
if(pResult->NumArguments() >= 1)
|
||||
|
@ -1417,7 +1391,7 @@ void CServer::ConKick(IConsole::IResult *pResult, void *pUser, int ClientId)
|
|||
((CServer *)pUser)->Kick(Victim, "Kicked by console");
|
||||
}
|
||||
|
||||
void CServer::ConBan(IConsole::IResult *pResult, void *pUser, int ClientId1)
|
||||
void CServer::ConBan(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||
{
|
||||
NETADDR Addr;
|
||||
CServer *pServer = (CServer *)pUser;
|
||||
|
@ -1433,9 +1407,9 @@ void CServer::ConBan(IConsole::IResult *pResult, void *pUser, int ClientId1)
|
|||
|
||||
if(net_addr_from_str(&Addr, pStr) == 0)
|
||||
{
|
||||
if(pServer->m_RconClientId >= 0 && pServer->m_RconClientId < MAX_CLIENTS && pServer->m_aClients[pServer->m_RconClientId].m_State != CClient::STATE_EMPTY)
|
||||
if(pServer->m_RconClientID >= 0 && pServer->m_RconClientID < MAX_CLIENTS && pServer->m_aClients[pServer->m_RconClientID].m_State != CClient::STATE_EMPTY)
|
||||
{
|
||||
NETADDR AddrCheck = pServer->m_NetServer.ClientAddr(pServer->m_RconClientId);
|
||||
NETADDR AddrCheck = pServer->m_NetServer.ClientAddr(pServer->m_RconClientID);
|
||||
Addr.port = AddrCheck.port = 0;
|
||||
if(net_addr_comp(&Addr, &AddrCheck) == 0)
|
||||
{
|
||||
|
@ -1449,7 +1423,7 @@ void CServer::ConBan(IConsole::IResult *pResult, void *pUser, int ClientId1)
|
|||
Addr.port = Temp.port = 0;
|
||||
if(net_addr_comp(&Addr, &Temp) == 0)
|
||||
{
|
||||
if ((((CServer *)pUser)->m_aClients[ClientId1].m_Authed > 0) && ((CServer *)pUser)->m_aClients[ClientId1].m_Authed <= ((CServer *)pUser)->m_aClients[i].m_Authed)
|
||||
if ((((CServer *)pUser)->m_aClients[ClientID].m_Authed > 0) && ((CServer *)pUser)->m_aClients[ClientID].m_Authed <= ((CServer *)pUser)->m_aClients[i].m_Authed)
|
||||
{
|
||||
pServer->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", "you can\'t ban a player with higher or same level");
|
||||
return;
|
||||
|
@ -1460,24 +1434,24 @@ void CServer::ConBan(IConsole::IResult *pResult, void *pUser, int ClientId1)
|
|||
}
|
||||
else if(StrAllnum(pStr))
|
||||
{
|
||||
int ClientId = str_toint(pStr);
|
||||
int TempClientID = str_toint(pStr);
|
||||
|
||||
if(ClientId < 0 || ClientId >= MAX_CLIENTS || pServer->m_aClients[ClientId].m_State == CClient::STATE_EMPTY)
|
||||
if(TempClientID < 0 || TempClientID >= MAX_CLIENTS || pServer->m_aClients[TempClientID].m_State == CClient::STATE_EMPTY)
|
||||
{
|
||||
pServer->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "server", "invalid client id");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ClientId1 != -1 && ((CServer *)pUser)->m_aClients[ClientId1].m_Authed <= ((CServer *)pUser)->m_aClients[ClientId].m_Authed)
|
||||
if (ClientID != -1 && ((CServer *)pUser)->m_aClients[ClientID].m_Authed <= ((CServer *)pUser)->m_aClients[TempClientID].m_Authed)
|
||||
return;
|
||||
|
||||
else if(pServer->m_RconClientId == ClientId)
|
||||
else if(pServer->m_RconClientID == TempClientID)
|
||||
{
|
||||
pServer->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "server", "you can't ban yourself");
|
||||
return;
|
||||
}
|
||||
|
||||
Addr = pServer->m_NetServer.ClientAddr(ClientId);
|
||||
Addr = pServer->m_NetServer.ClientAddr(TempClientID);
|
||||
pServer->BanAdd(Addr, Minutes*60, pReason);
|
||||
}
|
||||
else
|
||||
|
@ -1487,7 +1461,7 @@ void CServer::ConBan(IConsole::IResult *pResult, void *pUser, int ClientId1)
|
|||
}
|
||||
}
|
||||
|
||||
void CServer::ConUnban(IConsole::IResult *pResult, void *pUser, int ClientId)
|
||||
void CServer::ConUnban(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||
{
|
||||
NETADDR Addr;
|
||||
CServer *pServer = (CServer *)pUser;
|
||||
|
@ -1516,7 +1490,7 @@ void CServer::ConUnban(IConsole::IResult *pResult, void *pUser, int ClientId)
|
|||
pServer->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "server", "invalid network address");
|
||||
}
|
||||
|
||||
void CServer::ConBans(IConsole::IResult *pResult, void *pUser, int ClientId)
|
||||
void CServer::ConBans(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||
{
|
||||
unsigned Now = time_timestamp();
|
||||
char aBuf[1024];
|
||||
|
@ -1544,7 +1518,7 @@ void CServer::ConBans(IConsole::IResult *pResult, void *pUser, int ClientId)
|
|||
pServer->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "Server", aBuf);
|
||||
}
|
||||
|
||||
void CServer::ConStatus(IConsole::IResult *pResult, void *pUser, int ClientId)
|
||||
void CServer::ConStatus(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||
{
|
||||
int i;
|
||||
NETADDR Addr;
|
||||
|
@ -1568,12 +1542,12 @@ void CServer::ConStatus(IConsole::IResult *pResult, void *pUser, int ClientId)
|
|||
}
|
||||
}
|
||||
|
||||
void CServer::ConShutdown(IConsole::IResult *pResult, void *pUser, int ClientId)
|
||||
void CServer::ConShutdown(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||
{
|
||||
((CServer *)pUser)->m_RunServer = 0;
|
||||
}
|
||||
|
||||
void CServer::ConRecord(IConsole::IResult *pResult, void *pUser, int ClientId)
|
||||
void CServer::ConRecord(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||
{
|
||||
CServer* pServer = (CServer *)pUser;
|
||||
char aFilename[128];
|
||||
|
@ -1589,28 +1563,16 @@ void CServer::ConRecord(IConsole::IResult *pResult, void *pUser, int ClientId)
|
|||
pServer->m_DemoRecorder.Start(pServer->Storage(), pServer->Console(), aFilename, pServer->GameServer()->NetVersion(), pServer->m_aCurrentMap, pServer->m_CurrentMapCrc, "server");
|
||||
}
|
||||
|
||||
void CServer::ConStopRecord(IConsole::IResult *pResult, void *pUser, int ClientId)
|
||||
void CServer::ConStopRecord(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||
{
|
||||
((CServer *)pUser)->m_DemoRecorder.Stop();
|
||||
}
|
||||
|
||||
void CServer::ConMapReload(IConsole::IResult *pResult, void *pUser, int ClientId)
|
||||
void CServer::ConMapReload(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||
{
|
||||
((CServer *)pUser)->m_MapReload = 1;
|
||||
}
|
||||
|
||||
void CServer::ConCmdList(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
{
|
||||
CServer *pSelf = (CServer *)pUserData;
|
||||
|
||||
if(pResult->NumArguments() == 0)
|
||||
pSelf->Console()->List((pSelf->m_aClients[ClientId].m_Authed != 0) ? pSelf->m_aClients[ClientId].m_Authed : -1, CFGFLAG_SERVER);
|
||||
else if (pResult->GetInteger(0) == 0)
|
||||
pSelf->Console()->List(-1, CFGFLAG_SERVER);
|
||||
else
|
||||
pSelf->Console()->List(pResult->GetInteger(0), CFGFLAG_SERVER);
|
||||
}
|
||||
|
||||
void CServer::ConchainSpecialInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
|
||||
{
|
||||
pfnCallback(pResult, pCallbackUserData, -1);
|
||||
|
@ -1625,33 +1587,6 @@ void CServer::ConchainMaxclientsperipUpdate(IConsole::IResult *pResult, void *pU
|
|||
((CServer *)pUserData)->m_NetServer.SetMaxClientsPerIP(pResult->GetInteger(0));
|
||||
}
|
||||
|
||||
void CServer::ConLogin(IConsole::IResult *pResult, void *pUser, int ClientId)
|
||||
{
|
||||
if(pResult->NumArguments())
|
||||
((CServer *)pUser)->CheckPass(ClientId, pResult->GetString(0));
|
||||
else
|
||||
((CServer *)pUser)->SetRconLevel(ClientId, 0);
|
||||
}
|
||||
|
||||
bool CServer::CompareClients(int ClientLevel, int Victim, void *pUser)
|
||||
{
|
||||
CServer* pSelf = (CServer *)pUser;
|
||||
|
||||
if(!ClientOnline(Victim, pSelf))
|
||||
return false;
|
||||
|
||||
return clamp(ClientLevel, 0, 4) > clamp(pSelf->m_aClients[Victim].m_Authed, 0, 4);
|
||||
}
|
||||
|
||||
bool CServer::ClientOnline(int ClientId, void *pUser)
|
||||
{
|
||||
CServer* pSelf = (CServer *)pUser;
|
||||
if(ClientId < 0 || ClientId >= MAX_CLIENTS)
|
||||
return false;
|
||||
|
||||
return pSelf->m_aClients[ClientId].m_State != CClient::STATE_EMPTY;
|
||||
}
|
||||
|
||||
void CServer::RegisterCommands()
|
||||
{
|
||||
m_pConsole = Kernel()->RequestInterface<IConsole>();
|
||||
|
@ -1695,11 +1630,11 @@ void CServer::SnapFreeID(int ID)
|
|||
}
|
||||
|
||||
|
||||
void *CServer::SnapNewItem(int Type, int Id, int Size)
|
||||
void *CServer::SnapNewItem(int Type, int ID, int Size)
|
||||
{
|
||||
dbg_assert(Type >= 0 && Type <=0xffff, "incorrect type");
|
||||
dbg_assert(Id >= 0 && Id <=0xffff, "incorrect id");
|
||||
return Id < 0 ? 0 : m_SnapshotBuilder.NewItem(Type, Id, Size);
|
||||
dbg_assert(ID >= 0 && ID <=0xffff, "incorrect id");
|
||||
return ID < 0 ? 0 : m_SnapshotBuilder.NewItem(Type, ID, Size);
|
||||
}
|
||||
|
||||
void CServer::SnapSetStaticsize(int ItemType, int Size)
|
||||
|
@ -1802,28 +1737,28 @@ int main(int argc, const char **argv) // ignore_convention
|
|||
return 0;
|
||||
}
|
||||
|
||||
void CServer::SetRconLevel(int ClientId, int Level)
|
||||
void CServer::SetRconLevel(int ClientID, int Level)
|
||||
{
|
||||
if(Level < 0)
|
||||
{
|
||||
dbg_msg("server", "%s set to level 0. ClientId=%x ip=%d.%d.%d.%d",ClientName(ClientId), ClientId, m_aClients[ClientId].m_Addr.ip[0], m_aClients[ClientId].m_Addr.ip[1], m_aClients[ClientId].m_Addr.ip[2], m_aClients[ClientId].m_Addr.ip[3]);
|
||||
dbg_msg("server", "%s set to level 0. ClientID=%x ip=%d.%d.%d.%d",ClientName(ClientID), ClientID, m_aClients[ClientID].m_Addr.ip[0], m_aClients[ClientID].m_Addr.ip[1], m_aClients[ClientID].m_Addr.ip[2], m_aClients[ClientID].m_Addr.ip[3]);
|
||||
CMsgPacker Msg(NETMSG_RCON_AUTH_STATUS);
|
||||
Msg.AddInt(0);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL, ClientId, true);
|
||||
m_aClients[ClientId].m_Authed = 0;
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL, ClientID, true);
|
||||
m_aClients[ClientID].m_Authed = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dbg_msg("server", "%s set to level %d. ClientId=%x ip=%d.%d.%d.%d",ClientName(ClientId), Level, ClientId, m_aClients[ClientId].m_Addr.ip[0], m_aClients[ClientId].m_Addr.ip[1], m_aClients[ClientId].m_Addr.ip[2], m_aClients[ClientId].m_Addr.ip[3]);
|
||||
dbg_msg("server", "%s set to level %d. ClientID=%x ip=%d.%d.%d.%d",ClientName(ClientID), Level, ClientID, m_aClients[ClientID].m_Addr.ip[0], m_aClients[ClientID].m_Addr.ip[1], m_aClients[ClientID].m_Addr.ip[2], m_aClients[ClientID].m_Addr.ip[3]);
|
||||
CMsgPacker Msg(NETMSG_RCON_AUTH_STATUS);
|
||||
Msg.AddInt(1);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL, ClientId, true);
|
||||
m_aClients[ClientId].m_Authed = Level;
|
||||
GameServer()->OnSetAuthed(ClientId, m_aClients[ClientId].m_Authed);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL, ClientID, true);
|
||||
m_aClients[ClientID].m_Authed = Level;
|
||||
GameServer()->OnSetAuthed(ClientID, m_aClients[ClientID].m_Authed);
|
||||
}
|
||||
}
|
||||
|
||||
void CServer::CheckPass(int ClientId, const char *pPw)
|
||||
void CServer::CheckPass(int ClientID, const char *pPw)
|
||||
{
|
||||
|
||||
if(pPw[0] != 0)
|
||||
|
@ -1832,7 +1767,7 @@ void CServer::CheckPass(int ClientId, const char *pPw)
|
|||
g_Config.m_SvRconPasswordModer[0] == 0 &&
|
||||
g_Config.m_SvRconPasswordAdmin[0] == 0)
|
||||
{
|
||||
SendRconLine(ClientId, "No rcon password set on server. Set sv_admin_pass/sv_mod_pass/sv_helper_pass to enable the remote console.");
|
||||
SendRconLine(ClientID, "No rcon password set on server. Set sv_admin_pass/sv_mod_pass/sv_helper_pass to enable the remote console.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1840,11 +1775,11 @@ void CServer::CheckPass(int ClientId, const char *pPw)
|
|||
{
|
||||
CMsgPacker Msg(NETMSG_RCON_AUTH_STATUS);
|
||||
Msg.AddInt(1);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL, ClientId, true);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL, ClientID, true);
|
||||
|
||||
m_aClients[ClientId].m_Authed = 1;
|
||||
SendRconLine(ClientId, "Authentication successful. Remote console access granted.");
|
||||
dbg_msg("server", "ClientId=%d authed", ClientId);
|
||||
m_aClients[ClientID].m_Authed = 1;
|
||||
SendRconLine(ClientID, "Authentication successful. Remote console access granted.");
|
||||
dbg_msg("server", "ClientID=%d authed", ClientID);
|
||||
}*/
|
||||
int level = -1;
|
||||
if(str_comp(pPw, g_Config.m_SvRconPasswordHelper) == 0)
|
||||
|
@ -1861,25 +1796,25 @@ void CServer::CheckPass(int ClientId, const char *pPw)
|
|||
}
|
||||
if(level != -1)
|
||||
{
|
||||
char buf[128]="Authentication successful. Remote console access granted for ClientId=%d with level=%d";
|
||||
SetRconLevel(ClientId,level);
|
||||
str_format(buf,sizeof(buf),buf,ClientId,level);
|
||||
SendRconLine(ClientId, buf);
|
||||
dbg_msg("server", "'%s' ClientId=%d authed with Level=%d", ClientName(ClientId), ClientId, level);
|
||||
char buf[128]="Authentication successful. Remote console access granted for ClientID=%d with level=%d";
|
||||
SetRconLevel(ClientID,level);
|
||||
str_format(buf,sizeof(buf),buf,ClientID,level);
|
||||
SendRconLine(ClientID, buf);
|
||||
dbg_msg("server", "'%s' ClientID=%d authed with Level=%d", ClientName(ClientID), ClientID, level);
|
||||
}
|
||||
else if(g_Config.m_SvRconMaxTries)
|
||||
{
|
||||
m_aClients[ClientId].m_AuthTries++;
|
||||
m_aClients[ClientID].m_AuthTries++;
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof(aBuf), "Wrong password %d/%d.", m_aClients[ClientId].m_AuthTries, g_Config.m_SvRconMaxTries);
|
||||
SendRconLine(ClientId, aBuf);
|
||||
if(m_aClients[ClientId].m_AuthTries >= g_Config.m_SvRconMaxTries)
|
||||
str_format(aBuf, sizeof(aBuf), "Wrong password %d/%d.", m_aClients[ClientID].m_AuthTries, g_Config.m_SvRconMaxTries);
|
||||
SendRconLine(ClientID, aBuf);
|
||||
if(m_aClients[ClientID].m_AuthTries >= g_Config.m_SvRconMaxTries)
|
||||
{
|
||||
if(!g_Config.m_SvRconBantime)
|
||||
m_NetServer.Drop(ClientId, "Too many remote console authentication tries");
|
||||
m_NetServer.Drop(ClientID, "Too many remote console authentication tries");
|
||||
else
|
||||
{
|
||||
NETADDR Addr = m_NetServer.ClientAddr(ClientId);
|
||||
NETADDR Addr = m_NetServer.ClientAddr(ClientID);
|
||||
BanAdd(Addr, g_Config.m_SvRconBantime*60, "Too many remote console authentication tries");
|
||||
}
|
||||
}
|
||||
|
@ -1890,21 +1825,21 @@ void CServer::CheckPass(int ClientId, const char *pPw)
|
|||
{
|
||||
CMsgPacker Msg(NETMSG_RCON_AUTH_STATUS);
|
||||
Msg.AddInt(1);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL, ClientId, true);
|
||||
SendMsgEx(&Msg, MSGFLAG_VITAL, ClientID, true);
|
||||
|
||||
m_aClients[ClientId].m_Authed = 1;
|
||||
SendRconLine(ClientId, "Authentication successful. Remote console access granted.");
|
||||
m_aClients[ClientID].m_Authed = 1;
|
||||
SendRconLine(ClientID, "Authentication successful. Remote console access granted.");
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), "ClientId=%d authed", ClientId);
|
||||
str_format(aBuf, sizeof(aBuf), "ClientID=%d authed", ClientID);
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf);
|
||||
}*/
|
||||
else
|
||||
{
|
||||
char buf[128]="Authentication successful. Remote console access granted for ClientId=%d with level=%d";
|
||||
SetRconLevel(ClientId,0);
|
||||
str_format(buf,sizeof(buf),buf,ClientId,0);
|
||||
SendRconLine(ClientId, buf);
|
||||
dbg_msg("server", "'%s' ClientId=%d authed with Level=%d", ClientName(ClientId), ClientId, 0);
|
||||
char buf[128]="Authentication successful. Remote console access granted for ClientID=%d with level=%d";
|
||||
SetRconLevel(ClientID,0);
|
||||
str_format(buf,sizeof(buf),buf,ClientID,0);
|
||||
SendRconLine(ClientID, buf);
|
||||
dbg_msg("server", "'%s' ClientID=%d authed with Level=%d", ClientName(ClientID), ClientID, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1950,7 +1885,7 @@ NETADDR CServer::GetClientIP(int ClientID)//this may exist already but i couldn'
|
|||
return m_NetServer.ClientAddr(ClientID);
|
||||
}
|
||||
|
||||
void CServer::ConAddBanmaster(IConsole::IResult *pResult, void *pUser, int ClientId)
|
||||
void CServer::ConAddBanmaster(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||
{
|
||||
CServer *pServer = (CServer *)pUser;
|
||||
|
||||
|
@ -1964,7 +1899,7 @@ void CServer::ConAddBanmaster(IConsole::IResult *pResult, void *pUser, int Clien
|
|||
pServer->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "server/banmaster", "too many banmasters");
|
||||
}
|
||||
|
||||
void CServer::ConBanmasters(IConsole::IResult *pResult, void *pUser, int ClientId)
|
||||
void CServer::ConBanmasters(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||
{
|
||||
CServer *pServer = (CServer *)pUser;
|
||||
int NumBanmasters = pServer->m_NetServer.BanmasterNum();
|
||||
|
@ -1981,11 +1916,74 @@ void CServer::ConBanmasters(IConsole::IResult *pResult, void *pUser, int ClientI
|
|||
}
|
||||
}
|
||||
|
||||
void CServer::ConClearBanmasters(IConsole::IResult *pResult, void *pUser, int ClientId)
|
||||
void CServer::ConClearBanmasters(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||
{
|
||||
CServer *pServer = (CServer *)pUser;
|
||||
|
||||
pServer->m_NetServer.BanmastersClear();
|
||||
}
|
||||
|
||||
void CServer::SendRconResponse(const char *pLine, void *pUser)
|
||||
{
|
||||
RconResponseInfo *pInfo = (RconResponseInfo *)pUser;
|
||||
CServer *pThis = pInfo->m_Server;
|
||||
static volatile int ReentryGuard = 0;
|
||||
|
||||
if(ReentryGuard)
|
||||
return;
|
||||
|
||||
ReentryGuard++;
|
||||
|
||||
if(pThis->m_aClients[pInfo->m_ClientID].m_State != CClient::STATE_EMPTY)
|
||||
pThis->SendRconLine(pInfo->m_ClientID, pLine);
|
||||
|
||||
ReentryGuard--;
|
||||
}
|
||||
|
||||
void CServer::ConCmdList(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
CServer *pSelf = (CServer *)pUserData;
|
||||
|
||||
if(pResult->NumArguments() == 0)
|
||||
pSelf->Console()->List((pSelf->m_aClients[ClientID].m_Authed != 0) ? pSelf->m_aClients[ClientID].m_Authed : -1, CFGFLAG_SERVER);
|
||||
else if (pResult->GetInteger(0) == 0)
|
||||
pSelf->Console()->List(-1, CFGFLAG_SERVER);
|
||||
else
|
||||
pSelf->Console()->List(pResult->GetInteger(0), CFGFLAG_SERVER);
|
||||
}
|
||||
|
||||
void CServer::ConLogin(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||
{
|
||||
if(pResult->NumArguments())
|
||||
((CServer *)pUser)->CheckPass(ClientID, pResult->GetString(0));
|
||||
else
|
||||
((CServer *)pUser)->SetRconLevel(ClientID, 0);
|
||||
}
|
||||
|
||||
bool CServer::CompareClients(int ClientLevel, int Victim, void *pUser)
|
||||
{
|
||||
CServer* pSelf = (CServer *)pUser;
|
||||
|
||||
if(!ClientOnline(Victim, pSelf))
|
||||
return false;
|
||||
|
||||
return clamp(ClientLevel, 0, 4) > clamp(pSelf->m_aClients[Victim].m_Authed, 0, 4);
|
||||
}
|
||||
|
||||
bool CServer::ClientOnline(int ClientID, void *pUser)
|
||||
{
|
||||
CServer* pSelf = (CServer *)pUser;
|
||||
if(ClientID < 0 || ClientID >= MAX_CLIENTS)
|
||||
return false;
|
||||
|
||||
return pSelf->m_aClients[ClientID].m_State != CClient::STATE_EMPTY;
|
||||
}
|
||||
|
||||
void CServer::SetClientAuthed(int ClientID, int Level) {
|
||||
if(ClientID < 0 || ClientID >= MAX_CLIENTS || m_aClients[ClientID].m_State == CClient::STATE_READY)
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_aClients[ClientID].m_Authed = Level;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ class CSnapIDPool
|
|||
{
|
||||
enum
|
||||
{
|
||||
MAX_IDS = 16*1024,//TODO
|
||||
MAX_IDS = 16*1024,
|
||||
};
|
||||
|
||||
class CID
|
||||
|
@ -46,7 +46,7 @@ public:
|
|||
void RemoveFirstTimeout();
|
||||
int NewID();
|
||||
void TimeoutIDs();
|
||||
void FreeID(int Id);
|
||||
void FreeID(int ID);
|
||||
};
|
||||
|
||||
class CServer : public IServer
|
||||
|
@ -122,7 +122,7 @@ public:
|
|||
//int m_CurrentGameTick;
|
||||
int m_RunServer;
|
||||
int m_MapReload;
|
||||
int m_RconClientId;
|
||||
int m_RconClientID;
|
||||
|
||||
char m_aBrowseinfoGametype[16];
|
||||
int m_BrowseinfoProgression;
|
||||
|
@ -159,22 +159,21 @@ public:
|
|||
int IsAuthed(int ClientID);
|
||||
int GetClientInfo(int ClientID, CClientInfo *pInfo);
|
||||
void GetClientIP(int ClientID, char *pIPString, int Size);
|
||||
NETADDR GetClientIP(int ClientID);
|
||||
const char *ClientName(int ClientId);
|
||||
const char *ClientName(int ClientID);
|
||||
bool ClientIngame(int ClientID);
|
||||
|
||||
int *LatestInput(int ClientId, int *size);
|
||||
int *LatestInput(int ClientID, int *size);
|
||||
|
||||
virtual int SendMsg(CMsgPacker *pMsg, int Flags, int ClientId);
|
||||
virtual int SendMsg(CMsgPacker *pMsg, int Flags, int ClientID);
|
||||
int SendMsgEx(CMsgPacker *pMsg, int Flags, int ClientID, bool System);
|
||||
|
||||
void DoSnapshot();
|
||||
|
||||
static int NewClientCallback(int ClientId, void *pUser);
|
||||
static int DelClientCallback(int ClientId, const char *pReason, void *pUser);
|
||||
static int NewClientCallback(int ClientID, void *pUser);
|
||||
static int DelClientCallback(int ClientID, const char *pReason, void *pUser);
|
||||
|
||||
void SendMap(int ClientId);
|
||||
void SendRconLine(int ClientId, const char *pLine);
|
||||
void SendMap(int ClientID);
|
||||
void SendRconLine(int ClientID, const char *pLine);
|
||||
static void SendRconLineAuthed(const char *pLine, void *pUser);
|
||||
|
||||
static void SendRconResponse(const char *pLine, void *pUser);
|
||||
|
@ -182,7 +181,7 @@ public:
|
|||
struct RconResponseInfo
|
||||
{
|
||||
CServer *m_Server;
|
||||
int m_ClientId;
|
||||
int m_ClientID;
|
||||
};
|
||||
|
||||
void ProcessClientPacket(CNetChunk *pPacket);
|
||||
|
@ -203,38 +202,39 @@ public:
|
|||
void InitRegister(CNetServer *pNetServer, IEngineMasterServer *pMasterServer, IConsole *pConsole);
|
||||
int Run();
|
||||
|
||||
static void ConKick(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConBan(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConUnban(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConBans(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConStatus(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConShutdown(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConRecord(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConStopRecord(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConMapReload(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConKick(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
static void ConBan(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
static void ConUnban(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
static void ConBans(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
static void ConStatus(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
static void ConShutdown(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
static void ConRecord(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
static void ConStopRecord(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
static void ConMapReload(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
static void ConchainSpecialInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
||||
static void ConchainMaxclientsperipUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
||||
|
||||
static void ConLogin(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConCmdList(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConLogin(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
static void ConCmdList(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
|
||||
static bool CompareClients(int ClientId, int Victim, void *pUser);
|
||||
static bool ClientOnline(int ClientId, void *pUser);
|
||||
static bool CompareClients(int ClientID, int Victim, void *pUser);
|
||||
static bool ClientOnline(int ClientID, void *pUser);
|
||||
|
||||
void RegisterCommands();
|
||||
|
||||
void SetRconLevel(int ClientId, int Level);
|
||||
void CheckPass(int ClientId, const char *pPw);
|
||||
void SetRconLevel(int ClientID, int Level);
|
||||
void CheckPass(int ClientID, const char *pPw);
|
||||
char *GetAnnouncementLine(char const *FileName);
|
||||
unsigned m_AnnouncementLastLine;
|
||||
|
||||
virtual int SnapNewID();
|
||||
virtual void SnapFreeID(int ID);
|
||||
virtual void *SnapNewItem(int Type, int Id, int Size);
|
||||
virtual void *SnapNewItem(int Type, int ID, int Size);
|
||||
void SnapSetStaticsize(int ItemType, int Size);
|
||||
static void ConAddBanmaster(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConBanmasters(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConClearBanmasters(IConsole::IResult *pResult, void *pUser, int ClientId);
|
||||
static void ConAddBanmaster(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
static void ConBanmasters(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
static void ConClearBanmasters(IConsole::IResult *pResult, void *pUser, int ClientID);
|
||||
NETADDR GetClientIP(int ClientID);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -21,12 +21,6 @@ public:
|
|||
int m_Score;
|
||||
} ;
|
||||
|
||||
enum
|
||||
{
|
||||
FLAG_VERSION_VANILLA=0,
|
||||
FLAG_VERSION_DDRACE
|
||||
};
|
||||
|
||||
int m_SortedIndex;
|
||||
int m_ServerIndex;
|
||||
|
||||
|
@ -38,7 +32,6 @@ public:
|
|||
int m_MaxPlayers;
|
||||
int m_NumPlayers;
|
||||
int m_Flags;
|
||||
int m_FlagVersion;
|
||||
int m_Favorite;
|
||||
int m_Latency; // in ms
|
||||
char m_aGameType[16];
|
||||
|
@ -47,6 +40,12 @@ public:
|
|||
char m_aVersion[32];
|
||||
char m_aAddress[24];
|
||||
CPlayer m_aPlayers[16];
|
||||
int m_FlagVersion;
|
||||
enum
|
||||
{
|
||||
FLAG_VERSION_VANILLA=0,
|
||||
FLAG_VERSION_DDRACE
|
||||
};
|
||||
};
|
||||
|
||||
class IServerBrowser : public IInterface
|
||||
|
|
|
@ -177,7 +177,7 @@ MACRO_CONFIG_INT(SvSlashMe, sv_slash_me, 0, 0, 1, CFGFLAG_SERVER, "Whether /me i
|
|||
MACRO_CONFIG_INT(ConnTimeout, conn_timeout, 15, 5, 100, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Network timeout", 4)
|
||||
|
||||
MACRO_CONFIG_INT(DbgMsg, dbg_msg, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Display or not debug messages", 3)
|
||||
MACRO_CONFIG_INT(ClShowIds, cl_show_ids, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Whether to show client ids in scoreboard", -1)
|
||||
MACRO_CONFIG_INT(ClShowIDs, cl_show_ids, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Whether to show client ids in scoreboard", -1)
|
||||
MACRO_CONFIG_INT(BrFilterGametypeStrict, br_filter_gametype_strict, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter gametype strict", -1)
|
||||
MACRO_CONFIG_INT(BrFilterCheats, br_filter_cheats, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering cheats (default: 0 don't care, 1 must be Off, 2 must be On)", -1)
|
||||
MACRO_CONFIG_INT(BrFilterCheatTime, br_filter_cheat_time, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering cheats with time (default: 0 don't care, 1 must be Off, 2 must be On)", -1)
|
||||
|
|
|
@ -31,36 +31,6 @@ float CConsole::CResult::GetFloat(unsigned Index)
|
|||
return str_tofloat(m_apArgs[Index]);
|
||||
}
|
||||
|
||||
int CConsole::CResult::GetVictim()
|
||||
{
|
||||
return m_Victim;
|
||||
}
|
||||
|
||||
void CConsole::CResult::ResetVictim()
|
||||
{
|
||||
m_Victim = VICTIM_NONE;
|
||||
}
|
||||
|
||||
bool CConsole::CResult::HasVictim()
|
||||
{
|
||||
return m_Victim != VICTIM_NONE;
|
||||
}
|
||||
|
||||
void CConsole::CResult::SetVictim(int Victim)
|
||||
{
|
||||
m_Victim = clamp<int>(Victim, 0, MAX_CLIENTS);
|
||||
}
|
||||
|
||||
void CConsole::CResult::SetVictim(const char *pVictim)
|
||||
{
|
||||
if(!str_comp(pVictim, "me"))
|
||||
m_Victim = VICTIM_ME;
|
||||
else if(!str_comp(pVictim, "all"))
|
||||
m_Victim = VICTIM_ALL;
|
||||
else
|
||||
m_Victim = clamp<int>(str_toint(pVictim), 0, MAX_CLIENTS - 1);
|
||||
}
|
||||
|
||||
// the maximum number of tokens occurs in a string of length CONSOLE_MAX_STR_LENGTH with tokens size 1 separated by single spaces
|
||||
|
||||
|
||||
|
@ -204,9 +174,9 @@ void CConsole::Print(int Level, const char *pFrom, const char *pStr)
|
|||
char aBuf[1024];
|
||||
str_format(aBuf, sizeof(aBuf), "[%s]: %s", pFrom, pStr);
|
||||
if (!m_pfnAlternativePrintCallback || m_PrintUsed == 0)
|
||||
m_pfnPrintCallback(aBuf, m_pPrintCallbackUserdata);
|
||||
else
|
||||
m_pfnAlternativePrintCallback(aBuf, m_pAlternativePrintCallbackUserdata);
|
||||
m_pfnPrintCallback(aBuf, m_pPrintCallbackUserdata);
|
||||
else
|
||||
m_pfnAlternativePrintCallback(aBuf, m_pAlternativePrintCallbackUserdata);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -259,8 +229,7 @@ bool CConsole::LineIsValid(const char *pStr)
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, const int ClientLevel, const int ClientId, FPrintCallback pfnAlternativePrintCallback, void *pUserData, FPrintCallback pfnAlternativePrintResponseCallback, void *pResponseUserData)
|
||||
void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, const int ClientLevel, const int ClientID, FPrintCallback pfnAlternativePrintCallback, void *pUserData, FPrintCallback pfnAlternativePrintResponseCallback, void *pResponseUserData)
|
||||
{
|
||||
while(pStr && *pStr)
|
||||
{
|
||||
|
@ -324,10 +293,10 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, const int Client
|
|||
m_ExecutionQueue.m_pLast->m_pCommandUserData = pCommand->m_pUserData;
|
||||
m_ExecutionQueue.m_pLast->m_Result = Result;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if(Result.GetVictim() == CResult::VICTIM_ME)
|
||||
Result.SetVictim(ClientId);
|
||||
Result.SetVictim(ClientID);
|
||||
|
||||
if((ClientLevel < pCommand->m_Level && !(pCommand->m_Flags & CMDFLAG_HELPERCMD)) || (ClientLevel < 1 && (pCommand->m_Flags & CMDFLAG_HELPERCMD)))
|
||||
{
|
||||
|
@ -341,31 +310,31 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, const int Client
|
|||
else
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "You have too low level to use command: %s. Your level: %d. Need level: %d", pCommand->m_pName, ClientLevel, pCommand->m_Level);
|
||||
dbg_msg("server", "client tried rcon command ('%s') without permisson. ClientId=%d ", pCommand->m_pName, ClientId);
|
||||
dbg_msg("server", "client tried rcon command ('%s') without permisson. ClientID=%d ", pCommand->m_pName, ClientID);
|
||||
}
|
||||
PrintResponse(OUTPUT_LEVEL_STANDARD, "Console", aBuf);
|
||||
|
||||
ReleaseAlternativePrintResponseCallback();
|
||||
}
|
||||
else if(ClientLevel == 1 && (pCommand->m_Flags & CMDFLAG_HELPERCMD) && Result.GetVictim() != ClientId)
|
||||
else if(ClientLevel == 1 && (pCommand->m_Flags & CMDFLAG_HELPERCMD) && Result.GetVictim() != ClientID)
|
||||
{
|
||||
RegisterAlternativePrintResponseCallback(pfnAlternativePrintResponseCallback, pResponseUserData);
|
||||
PrintResponse(OUTPUT_LEVEL_STANDARD, "Console", "As a helper you can't use commands on others.");
|
||||
dbg_msg("server", "helper tried rcon command ('%s') on others without permission. ClientId=%d", pCommand->m_pName, ClientId);
|
||||
dbg_msg("server", "helper tried rcon command ('%s') on others without permission. ClientID=%d", pCommand->m_pName, ClientID);
|
||||
ReleaseAlternativePrintResponseCallback();
|
||||
}
|
||||
else if(!g_Config.m_SvCheats && (pCommand->m_Flags & CMDFLAG_CHEAT))
|
||||
{
|
||||
RegisterAlternativePrintResponseCallback(pfnAlternativePrintResponseCallback, pResponseUserData);
|
||||
PrintResponse(OUTPUT_LEVEL_STANDARD, "Console", "Cheats are not available on this server");
|
||||
dbg_msg("server", "client tried rcon cheat ('%s') with cheats off. ClientId=%d", pCommand->m_pName, ClientId);
|
||||
dbg_msg("server", "client tried rcon cheat ('%s') with cheats off. ClientID=%d", pCommand->m_pName, ClientID);
|
||||
ReleaseAlternativePrintResponseCallback();
|
||||
}
|
||||
else if(!g_Config.m_SvTimer && (pCommand->m_Flags & CMDFLAG_TIMER))
|
||||
{
|
||||
RegisterAlternativePrintResponseCallback(pfnAlternativePrintResponseCallback, pResponseUserData);
|
||||
PrintResponse(OUTPUT_LEVEL_STANDARD, "Console", "Timer commands are not available on this server");
|
||||
dbg_msg("server", "client tried timer command ('%s') with timer commands off. ClientId=%d", pCommand->m_pName, ClientId);
|
||||
dbg_msg("server", "client tried timer command ('%s') with timer commands off. ClientID=%d", pCommand->m_pName, ClientID);
|
||||
ReleaseAlternativePrintResponseCallback();
|
||||
}
|
||||
else
|
||||
|
@ -382,7 +351,7 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, const int Client
|
|||
RegisterAlternativePrintCallback(pfnAlternativePrintCallback, pUserData);
|
||||
RegisterAlternativePrintResponseCallback(pfnAlternativePrintResponseCallback, pResponseUserData);
|
||||
|
||||
pCommand->m_pfnCallback(&Result, pCommand->m_pUserData, ClientId);
|
||||
pCommand->m_pfnCallback(&Result, pCommand->m_pUserData, ClientID);
|
||||
|
||||
ReleaseAlternativePrintResponseCallback();
|
||||
ReleaseAlternativePrintCallback();
|
||||
|
@ -397,7 +366,7 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, const int Client
|
|||
PrintResponse(OUTPUT_LEVEL_STANDARD, "Console", "client is offline");
|
||||
ReleaseAlternativePrintResponseCallback();
|
||||
}
|
||||
else if (!CompareClients(ClientLevel, Result.GetVictim()) && ClientId != Result.GetVictim())
|
||||
else if (!CompareClients(ClientLevel, Result.GetVictim()) && ClientID != Result.GetVictim())
|
||||
{
|
||||
RegisterAlternativePrintResponseCallback(pfnAlternativePrintResponseCallback, pResponseUserData);
|
||||
PrintResponse(OUTPUT_LEVEL_STANDARD, "Console", "you can not use commands on players with the same or higher level than you");
|
||||
|
@ -408,7 +377,7 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, const int Client
|
|||
RegisterAlternativePrintCallback(pfnAlternativePrintCallback, pUserData);
|
||||
RegisterAlternativePrintResponseCallback(pfnAlternativePrintResponseCallback, pResponseUserData);
|
||||
|
||||
pCommand->m_pfnCallback(&Result, pCommand->m_pUserData, ClientId);
|
||||
pCommand->m_pfnCallback(&Result, pCommand->m_pUserData, ClientID);
|
||||
|
||||
ReleaseAlternativePrintResponseCallback();
|
||||
ReleaseAlternativePrintCallback();
|
||||
|
@ -420,7 +389,7 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, const int Client
|
|||
RegisterAlternativePrintCallback(pfnAlternativePrintCallback, pUserData);
|
||||
RegisterAlternativePrintResponseCallback(pfnAlternativePrintResponseCallback, pResponseUserData);
|
||||
|
||||
pCommand->m_pfnCallback(&Result, pCommand->m_pUserData, ClientId);
|
||||
pCommand->m_pfnCallback(&Result, pCommand->m_pUserData, ClientID);
|
||||
|
||||
ReleaseAlternativePrintResponseCallback();
|
||||
ReleaseAlternativePrintCallback();
|
||||
|
@ -472,10 +441,10 @@ CConsole::CCommand *CConsole::FindCommand(const char *pName, int FlagMask)
|
|||
return 0x0;
|
||||
}
|
||||
|
||||
void CConsole::ExecuteLine(const char *pStr, const int ClientLevel, const int ClientId, FPrintCallback pfnAlternativePrintCallback, void *pUserData, FPrintCallback pfnAlternativePrintResponseCallback, void *pResponseUserData)
|
||||
void CConsole::ExecuteLine(const char *pStr, const int ClientLevel, const int ClientID, FPrintCallback pfnAlternativePrintCallback, void *pUserData, FPrintCallback pfnAlternativePrintResponseCallback, void *pResponseUserData)
|
||||
{
|
||||
CConsole::ExecuteLineStroked(1, pStr, ClientLevel, ClientId, pfnAlternativePrintCallback, pUserData, pfnAlternativePrintResponseCallback, pResponseUserData); // press it
|
||||
CConsole::ExecuteLineStroked(0, pStr, ClientLevel, ClientId, pfnAlternativePrintCallback, pUserData, pfnAlternativePrintResponseCallback, pResponseUserData); // then release it
|
||||
CConsole::ExecuteLineStroked(1, pStr, ClientLevel, ClientID, pfnAlternativePrintCallback, pUserData, pfnAlternativePrintResponseCallback, pResponseUserData); // press it
|
||||
CConsole::ExecuteLineStroked(0, pStr, ClientLevel, ClientID, pfnAlternativePrintCallback, pUserData, pfnAlternativePrintResponseCallback, pResponseUserData); // then release it
|
||||
}
|
||||
|
||||
|
||||
|
@ -532,12 +501,12 @@ void CConsole::ExecuteFile(const char *pFilename, FPrintCallback pfnAlternativeP
|
|||
m_pFirstExec = pPrev;
|
||||
}
|
||||
|
||||
void CConsole::Con_Echo(IResult *pResult, void *pUserData, int ClientId)
|
||||
void CConsole::Con_Echo(IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
((CConsole*)pUserData)->Print(IConsole::OUTPUT_LEVEL_STANDARD, "Console", pResult->GetString(0));
|
||||
}
|
||||
|
||||
void CConsole::Con_Exec(IResult *pResult, void *pUserData, int ClientId)
|
||||
void CConsole::Con_Exec(IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
CConsole *pSelf = (CConsole *)pUserData;
|
||||
|
||||
|
@ -561,7 +530,7 @@ struct CStrVariableData
|
|||
int m_MaxSize;
|
||||
};
|
||||
|
||||
static void IntVariableCommand(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
static void IntVariableCommand(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
CIntVariableData *pData = (CIntVariableData *)pUserData;
|
||||
|
||||
|
@ -592,7 +561,7 @@ static void IntVariableCommand(IConsole::IResult *pResult, void *pUserData, int
|
|||
}
|
||||
}
|
||||
|
||||
static void StrVariableCommand(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
static void StrVariableCommand(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
CStrVariableData *pData = (CStrVariableData *)pUserData;
|
||||
|
||||
|
@ -653,12 +622,12 @@ CConsole::CConsole(int FlagMask)
|
|||
m_pAlternativePrintResponseCallbackUserdata = 0;
|
||||
m_pfnAlternativePrintResponseCallback = 0;
|
||||
m_PrintResponseUsed = 0;
|
||||
|
||||
|
||||
m_pfnClientOnlineCallback = 0;
|
||||
m_pfnCompareClientsCallback = 0;
|
||||
m_pClientOnlineUserdata = 0;
|
||||
m_pCompareClientsUserdata = 0;
|
||||
|
||||
|
||||
m_pStorage = 0;
|
||||
|
||||
// register some basic commands
|
||||
|
@ -726,7 +695,7 @@ void CConsole::Register(const char *pName, const char *pParams,
|
|||
m_aCommandCount[pCommand->m_Level]++;
|
||||
}
|
||||
|
||||
void CConsole::Con_Chain(IResult *pResult, void *pUserData, int ClientId)
|
||||
void CConsole::Con_Chain(IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
CChain *pInfo = (CChain *)pUserData;
|
||||
pInfo->m_pfnChainCallback(pResult, pInfo->m_pUserData, pInfo->m_pfnCallback, pInfo->m_pCallbackUserData);
|
||||
|
@ -759,12 +728,12 @@ void CConsole::Chain(const char *pName, FChainCommandCallback pfnChainFunc, void
|
|||
pCommand->m_pUserData = pChainInfo;
|
||||
}
|
||||
|
||||
void CConsole::StoreCommands(bool Store, int ClientId)
|
||||
void CConsole::StoreCommands(bool Store, int ClientID)
|
||||
{
|
||||
if(!Store)
|
||||
{
|
||||
for(CExecutionQueue::CQueueEntry *pEntry = m_ExecutionQueue.m_pFirst; pEntry; pEntry = pEntry->m_pNext)
|
||||
pEntry->m_pfnCommandCallback(&pEntry->m_Result, pEntry->m_pCommandUserData, ClientId);
|
||||
pEntry->m_pfnCommandCallback(&pEntry->m_Result, pEntry->m_pCommandUserData, ClientID);
|
||||
m_ExecutionQueue.Reset();
|
||||
}
|
||||
m_StoreCommands = Store;
|
||||
|
@ -807,20 +776,20 @@ void CConsole::RegisterCompareClientsCallback(FCompareClientsCallback pfnCallbac
|
|||
m_pCompareClientsUserdata = pUserData;
|
||||
}
|
||||
|
||||
bool CConsole::ClientOnline(int ClientId)
|
||||
bool CConsole::ClientOnline(int ClientID)
|
||||
{
|
||||
if(!m_pfnClientOnlineCallback)
|
||||
return true;
|
||||
|
||||
return m_pfnClientOnlineCallback(ClientId, m_pClientOnlineUserdata);
|
||||
return m_pfnClientOnlineCallback(ClientID, m_pClientOnlineUserdata);
|
||||
}
|
||||
|
||||
bool CConsole::CompareClients(int ClientId, int Victim)
|
||||
bool CConsole::CompareClients(int ClientID, int Victim)
|
||||
{
|
||||
if(!m_pfnCompareClientsCallback)
|
||||
return true;
|
||||
|
||||
return m_pfnCompareClientsCallback(ClientId, Victim, m_pCompareClientsUserdata);
|
||||
return m_pfnCompareClientsCallback(ClientID, Victim, m_pCompareClientsUserdata);
|
||||
}
|
||||
|
||||
void CConsole::RegisterPrintResponseCallback(FPrintCallback pfnPrintResponseCallback, void *pUserData)
|
||||
|
@ -916,3 +885,33 @@ void CConsole::List(int Level, int Flags)
|
|||
}
|
||||
}
|
||||
|
||||
int CConsole::CResult::GetVictim()
|
||||
{
|
||||
return m_Victim;
|
||||
}
|
||||
|
||||
void CConsole::CResult::ResetVictim()
|
||||
{
|
||||
m_Victim = VICTIM_NONE;
|
||||
}
|
||||
|
||||
bool CConsole::CResult::HasVictim()
|
||||
{
|
||||
return m_Victim != VICTIM_NONE;
|
||||
}
|
||||
|
||||
void CConsole::CResult::SetVictim(int Victim)
|
||||
{
|
||||
m_Victim = clamp<int>(Victim, 0, MAX_CLIENTS);
|
||||
}
|
||||
|
||||
void CConsole::CResult::SetVictim(const char *pVictim)
|
||||
{
|
||||
if(!str_comp(pVictim, "me"))
|
||||
m_Victim = VICTIM_ME;
|
||||
else if(!str_comp(pVictim, "all"))
|
||||
m_Victim = VICTIM_ALL;
|
||||
else
|
||||
m_Victim = clamp<int>(str_toint(pVictim), 0, MAX_CLIENTS - 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,12 +45,12 @@ class CConsole : public IConsole
|
|||
CExecFile *m_pFirstExec;
|
||||
class IStorage *m_pStorage;
|
||||
|
||||
static void Con_Chain(IResult *pResult, void *pUserData, int ClientId);
|
||||
static void Con_Echo(IResult *pResult, void *pUserData, int ClientId);
|
||||
static void Con_Exec(IResult *pResult, void *pUserData, int ClientId);
|
||||
static void Con_Chain(IResult *pResult, void *pUserData, int ClientID);
|
||||
static void Con_Echo(IResult *pResult, void *pUserData, int ClientID);
|
||||
static void Con_Exec(IResult *pResult, void *pUserData, int ClientID);
|
||||
|
||||
void ExecuteFileRecurse(const char *pFilename, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0, int Level = 3);
|
||||
virtual void ExecuteLineStroked(int Stroke, const char *pStr, const int ClientLevel, const int ClientId, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0);
|
||||
virtual void ExecuteLineStroked(int Stroke, const char *pStr, const int ClientLevel, const int ClientID, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0);
|
||||
|
||||
FPrintCallback m_pfnPrintCallback;
|
||||
void *m_pPrintCallbackUserdata;
|
||||
|
@ -179,10 +179,10 @@ public:
|
|||
virtual void Register(const char *pName, const char *pParams, int Flags, FCommandCallback pfnFunc, void *pUser, const char *pHelp, const int Level);
|
||||
virtual void List(const int Level, int Flags);
|
||||
virtual void Chain(const char *pName, FChainCommandCallback pfnChainFunc, void *pUser);
|
||||
virtual void StoreCommands(bool Store, int ClientId);
|
||||
virtual void StoreCommands(bool Store, int ClientID);
|
||||
|
||||
virtual bool LineIsValid(const char *pStr);
|
||||
virtual void ExecuteLine(const char *pStr, const int ClientLevel, const int ClientId, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0);
|
||||
virtual void ExecuteLine(const char *pStr, const int ClientLevel, const int ClientID, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0);
|
||||
virtual void ExecuteFile(const char *pFilename, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0, int Level = 3);
|
||||
|
||||
virtual void RegisterPrintCallback(FPrintCallback pfnPrintCallback, void *pUserData);
|
||||
|
@ -197,7 +197,7 @@ public:
|
|||
virtual void RegisterClientOnlineCallback(FClientOnlineCallback pfnCallback, void *pUserData);
|
||||
|
||||
virtual bool CompareClients(int ClientLevel, int Victim);
|
||||
virtual bool ClientOnline(int ClientId);
|
||||
virtual bool ClientOnline(int ClientID);
|
||||
|
||||
virtual void Print(int Level, const char *pFrom, const char *pStr);
|
||||
virtual void PrintResponse(int Level, const char *pFrom, const char *pStr);
|
||||
|
|
|
@ -18,13 +18,13 @@ struct CDatafileItemType
|
|||
|
||||
struct CDatafileItem
|
||||
{
|
||||
int m_TypeAndId;
|
||||
int m_TypeAndID;
|
||||
int m_Size;
|
||||
};
|
||||
|
||||
struct CDatafileHeader
|
||||
{
|
||||
char m_aId[4];
|
||||
char m_aID[4];
|
||||
int m_Version;
|
||||
int m_Size;
|
||||
int m_Swaplen;
|
||||
|
@ -104,11 +104,11 @@ bool CDataFileReader::Open(class IStorage *pStorage, const char *pFilename, int
|
|||
// TODO: change this header
|
||||
CDatafileHeader Header;
|
||||
io_read(File, &Header, sizeof(Header));
|
||||
if(Header.m_aId[0] != 'A' || Header.m_aId[1] != 'T' || Header.m_aId[2] != 'A' || Header.m_aId[3] != 'D')
|
||||
if(Header.m_aID[0] != 'A' || Header.m_aID[1] != 'T' || Header.m_aID[2] != 'A' || Header.m_aID[3] != 'D')
|
||||
{
|
||||
if(Header.m_aId[0] != 'D' || Header.m_aId[1] != 'A' || Header.m_aId[2] != 'T' || Header.m_aId[3] != 'A')
|
||||
if(Header.m_aID[0] != 'D' || Header.m_aID[1] != 'A' || Header.m_aID[2] != 'T' || Header.m_aID[3] != 'A')
|
||||
{
|
||||
dbg_msg("datafile", "wrong signature. %x %x %x %x", Header.m_aId[0], Header.m_aId[1], Header.m_aId[2], Header.m_aId[3]);
|
||||
dbg_msg("datafile", "wrong signature. %x %x %x %x", Header.m_aID[0], Header.m_aID[1], Header.m_aID[2], Header.m_aID[3]);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -318,15 +318,15 @@ int CDataFileReader::GetItemSize(int Index)
|
|||
return m_pDataFile->m_Info.m_pItemOffsets[Index+1]-m_pDataFile->m_Info.m_pItemOffsets[Index];
|
||||
}
|
||||
|
||||
void *CDataFileReader::GetItem(int Index, int *pType, int *pId)
|
||||
void *CDataFileReader::GetItem(int Index, int *pType, int *pID)
|
||||
{
|
||||
if(!m_pDataFile) { if(pType) *pType = 0; if(pId) *pId = 0; return 0; }
|
||||
if(!m_pDataFile) { if(pType) *pType = 0; if(pID) *pID = 0; return 0; }
|
||||
|
||||
CDatafileItem *i = (CDatafileItem *)(m_pDataFile->m_Info.m_pItemStart+m_pDataFile->m_Info.m_pItemOffsets[Index]);
|
||||
if(pType)
|
||||
*pType = (i->m_TypeAndId>>16)&0xffff; // remove sign extention
|
||||
if(pId)
|
||||
*pId = i->m_TypeAndId&0xffff;
|
||||
*pType = (i->m_TypeAndID>>16)&0xffff; // remove sign extention
|
||||
if(pID)
|
||||
*pID = i->m_TypeAndID&0xffff;
|
||||
return (void *)(i+1);
|
||||
}
|
||||
|
||||
|
@ -349,7 +349,7 @@ void CDataFileReader::GetType(int Type, int *pStart, int *pNum)
|
|||
}
|
||||
}
|
||||
|
||||
void *CDataFileReader::FindItem(int Type, int Id)
|
||||
void *CDataFileReader::FindItem(int Type, int ID)
|
||||
{
|
||||
if(!m_pDataFile) return 0;
|
||||
|
||||
|
@ -357,9 +357,9 @@ void *CDataFileReader::FindItem(int Type, int Id)
|
|||
GetType(Type, &Start, &Num);
|
||||
for(int i = 0; i < Num; i++)
|
||||
{
|
||||
int ItemId;
|
||||
void *pItem = GetItem(Start+i,0, &ItemId);
|
||||
if(Id == ItemId)
|
||||
int ItemID;
|
||||
void *pItem = GetItem(Start+i,0, &ItemID);
|
||||
if(ID == ItemID)
|
||||
return pItem;
|
||||
}
|
||||
return 0;
|
||||
|
@ -414,7 +414,7 @@ bool CDataFileWriter::Open(class IStorage *pStorage, const char *pFilename)
|
|||
return true;
|
||||
}
|
||||
|
||||
int CDataFileWriter::AddItem(int Type, int Id, int Size, void *pData)
|
||||
int CDataFileWriter::AddItem(int Type, int ID, int Size, void *pData)
|
||||
{
|
||||
if(!m_File) return 0;
|
||||
|
||||
|
@ -423,7 +423,7 @@ int CDataFileWriter::AddItem(int Type, int Id, int Size, void *pData)
|
|||
dbg_assert(Size%sizeof(int) == 0, "incorrect boundary");
|
||||
|
||||
m_aItems[m_NumItems].m_Type = Type;
|
||||
m_aItems[m_NumItems].m_Id = Id;
|
||||
m_aItems[m_NumItems].m_ID = ID;
|
||||
m_aItems[m_NumItems].m_Size = Size;
|
||||
|
||||
// copy data
|
||||
|
@ -533,10 +533,10 @@ int CDataFileWriter::Finish()
|
|||
|
||||
// construct Header
|
||||
{
|
||||
Header.m_aId[0] = 'D';
|
||||
Header.m_aId[1] = 'A';
|
||||
Header.m_aId[2] = 'T';
|
||||
Header.m_aId[3] = 'A';
|
||||
Header.m_aID[0] = 'D';
|
||||
Header.m_aID[1] = 'A';
|
||||
Header.m_aID[2] = 'T';
|
||||
Header.m_aID[3] = 'A';
|
||||
Header.m_Version = 4;
|
||||
Header.m_Size = FileSize - 16;
|
||||
Header.m_Swaplen = SwapSize - 16;
|
||||
|
@ -634,10 +634,10 @@ int CDataFileWriter::Finish()
|
|||
while(k != -1)
|
||||
{
|
||||
CDatafileItem Item;
|
||||
Item.m_TypeAndId = (i<<16)|m_aItems[k].m_Id;
|
||||
Item.m_TypeAndID = (i<<16)|m_aItems[k].m_ID;
|
||||
Item.m_Size = m_aItems[k].m_Size;
|
||||
if(DEBUG)
|
||||
dbg_msg("datafile", "writing item type=%x idx=%d id=%d size=%d", i, k, m_aItems[k].m_Id, m_aItems[k].m_Size);
|
||||
dbg_msg("datafile", "writing item type=%x idx=%d id=%d size=%d", i, k, m_aItems[k].m_ID, m_aItems[k].m_Size);
|
||||
|
||||
#if defined(CONF_ARCH_ENDIAN_BIG)
|
||||
swap_endian(&Item, sizeof(int), sizeof(Item)/sizeof(int));
|
||||
|
|
|
@ -21,10 +21,10 @@ public:
|
|||
void *GetDataSwapped(int Index); // makes sure that the data is 32bit LE ints when saved
|
||||
int GetDataSize(int Index);
|
||||
void UnloadData(int Index);
|
||||
void *GetItem(int Index, int *pType, int *pId);
|
||||
void *GetItem(int Index, int *pType, int *pID);
|
||||
int GetItemSize(int Index);
|
||||
void GetType(int Type, int *pStart, int *pNum);
|
||||
void *FindItem(int Type, int Id);
|
||||
void *FindItem(int Type, int ID);
|
||||
int NumItems();
|
||||
int NumData();
|
||||
void Unload();
|
||||
|
@ -45,7 +45,7 @@ class CDataFileWriter
|
|||
struct CItemInfo
|
||||
{
|
||||
int m_Type;
|
||||
int m_Id;
|
||||
int m_ID;
|
||||
int m_Size;
|
||||
int m_Next;
|
||||
int m_Prev;
|
||||
|
@ -72,7 +72,7 @@ public:
|
|||
bool Open(class IStorage *pStorage, const char *Filename);
|
||||
int AddData(int Size, void *pData);
|
||||
int AddDataSwapped(int Size, void *pData);
|
||||
int AddItem(int Type, int Id, int Size, void *pData);
|
||||
int AddItem(int Type, int ID, int Size, void *pData);
|
||||
int Finish();
|
||||
};
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@ public:
|
|||
virtual void *GetData(int Index) { return m_DataFile.GetData(Index); }
|
||||
virtual void *GetDataSwapped(int Index) { return m_DataFile.GetDataSwapped(Index); }
|
||||
virtual void UnloadData(int Index) { m_DataFile.UnloadData(Index); }
|
||||
virtual void *GetItem(int Index, int *pType, int *pId) { return m_DataFile.GetItem(Index, pType, pId); }
|
||||
virtual void *GetItem(int Index, int *pType, int *pID) { return m_DataFile.GetItem(Index, pType, pID); }
|
||||
virtual void GetType(int Type, int *pStart, int *pNum) { m_DataFile.GetType(Type, pStart, pNum); }
|
||||
virtual void *FindItem(int Type, int Id) { return m_DataFile.FindItem(Type, Id); }
|
||||
virtual void *FindItem(int Type, int ID) { return m_DataFile.FindItem(Type, ID); }
|
||||
virtual int NumItems() { return m_DataFile.NumItems(); }
|
||||
|
||||
virtual void Unload()
|
||||
|
|
|
@ -60,8 +60,6 @@ bool CNetServer::Open(NETADDR BindAddr, int MaxClients, int MaxClientsPerIP, int
|
|||
m_BanPool[NET_SERVER_MAXBANS-1].m_pPrev = &m_BanPool[NET_SERVER_MAXBANS-2];
|
||||
m_BanPool_FirstFree = &m_BanPool[0];
|
||||
|
||||
m_Flags = Flags;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -391,7 +389,6 @@ int CNetServer::Recv(CNetChunk *pChunk)
|
|||
m_aSlots[i].m_Connection.Feed(&m_RecvUnpacker.m_Data, &Addr);
|
||||
if(m_pfnNewClient)
|
||||
m_pfnNewClient(i, m_UserPtr);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -286,7 +286,7 @@ int CSnapshotDelta::UnpackDelta(CSnapshot *pFrom, CSnapshot *pTo, void *pSrcData
|
|||
CSnapshotItem *pFromItem;
|
||||
int Keep, ItemSize;
|
||||
int *pDeleted;
|
||||
int Id, Type, Key;
|
||||
int ID, Type, Key;
|
||||
int FromIndex;
|
||||
int *pNewData;
|
||||
|
||||
|
@ -330,7 +330,7 @@ int CSnapshotDelta::UnpackDelta(CSnapshot *pFrom, CSnapshot *pTo, void *pSrcData
|
|||
return -1;
|
||||
|
||||
Type = *pData++;
|
||||
Id = *pData++;
|
||||
ID = *pData++;
|
||||
if(m_aItemSizes[Type])
|
||||
ItemSize = m_aItemSizes[Type];
|
||||
else
|
||||
|
@ -343,7 +343,7 @@ int CSnapshotDelta::UnpackDelta(CSnapshot *pFrom, CSnapshot *pTo, void *pSrcData
|
|||
|
||||
if(RangeCheck(pEnd, pData, ItemSize) || ItemSize < 0) return -3;
|
||||
|
||||
Key = (Type<<16)|Id;
|
||||
Key = (Type<<16)|ID;
|
||||
|
||||
// create the item if needed
|
||||
pNewData = Builder.GetItemData(Key);
|
||||
|
|
|
@ -18,12 +18,12 @@ public:
|
|||
|
||||
virtual int LoadWV(const char *pFilename) = 0;
|
||||
|
||||
virtual void SetChannel(int ChannelId, float Volume, float Panning) = 0;
|
||||
virtual void SetChannel(int ChannelID, float Volume, float Panning) = 0;
|
||||
virtual void SetListenerPos(float x, float y) = 0;
|
||||
|
||||
virtual int PlayAt(int ChannelId, int SoundId, int Flags, float x, float y) = 0;
|
||||
virtual int Play(int ChannelId, int SoundId, int Flags) = 0;
|
||||
virtual void Stop(int VoiceId) = 0;
|
||||
virtual int PlayAt(int ChannelID, int SoundID, int Flags, float x, float y) = 0;
|
||||
virtual int Play(int ChannelID, int SoundID, int Flags) = 0;
|
||||
virtual void Stop(int VoiceID) = 0;
|
||||
virtual void StopAll() = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -26,17 +26,17 @@ CBinds::CBinds()
|
|||
m_SpecialBinds.m_pBinds = this;
|
||||
}
|
||||
|
||||
void CBinds::Bind(int KeyId, const char *pStr)
|
||||
void CBinds::Bind(int KeyID, const char *pStr)
|
||||
{
|
||||
if(KeyId < 0 || KeyId >= KEY_LAST)
|
||||
if(KeyID < 0 || KeyID >= KEY_LAST)
|
||||
return;
|
||||
|
||||
str_copy(m_aaKeyBindings[KeyId], pStr, sizeof(m_aaKeyBindings[KeyId]));
|
||||
str_copy(m_aaKeyBindings[KeyID], pStr, sizeof(m_aaKeyBindings[KeyID]));
|
||||
char aBuf[256];
|
||||
if(!m_aaKeyBindings[KeyId][0])
|
||||
str_format(aBuf, sizeof(aBuf), "unbound %s (%d)", Input()->KeyName(KeyId), KeyId);
|
||||
if(!m_aaKeyBindings[KeyID][0])
|
||||
str_format(aBuf, sizeof(aBuf), "unbound %s (%d)", Input()->KeyName(KeyID), KeyID);
|
||||
else
|
||||
str_format(aBuf, sizeof(aBuf), "bound %s (%d) = %s", Input()->KeyName(KeyId), KeyId, m_aaKeyBindings[KeyId]);
|
||||
str_format(aBuf, sizeof(aBuf), "bound %s (%d) = %s", Input()->KeyName(KeyID), KeyID, m_aaKeyBindings[KeyID]);
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "binds", aBuf);
|
||||
}
|
||||
|
||||
|
@ -60,10 +60,10 @@ void CBinds::UnbindAll()
|
|||
m_aaKeyBindings[i][0] = 0;
|
||||
}
|
||||
|
||||
const char *CBinds::Get(int KeyId)
|
||||
const char *CBinds::Get(int KeyID)
|
||||
{
|
||||
if(KeyId > 0 && KeyId < KEY_LAST)
|
||||
return m_aaKeyBindings[KeyId];
|
||||
if(KeyID > 0 && KeyID < KEY_LAST)
|
||||
return m_aaKeyBindings[KeyID];
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ void CBinds::ConBind(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
|||
{
|
||||
CBinds *pBinds = (CBinds *)pUserData;
|
||||
const char *pKeyName = pResult->GetString(0);
|
||||
int id = pBinds->GetKeyId(pKeyName);
|
||||
int id = pBinds->GetKeyID(pKeyName);
|
||||
|
||||
if(!id)
|
||||
{
|
||||
|
@ -154,7 +154,7 @@ void CBinds::ConUnbind(IConsole::IResult *pResult, void *pUserData, int ClientID
|
|||
{
|
||||
CBinds *pBinds = (CBinds *)pUserData;
|
||||
const char *pKeyName = pResult->GetString(0);
|
||||
int id = pBinds->GetKeyId(pKeyName);
|
||||
int id = pBinds->GetKeyID(pKeyName);
|
||||
|
||||
if(!id)
|
||||
{
|
||||
|
@ -188,7 +188,7 @@ void CBinds::ConDumpBinds(IConsole::IResult *pResult, void *pUserData, int Clien
|
|||
}
|
||||
}
|
||||
|
||||
int CBinds::GetKeyId(const char *pKeyName)
|
||||
int CBinds::GetKeyID(const char *pKeyName)
|
||||
{
|
||||
// check for numeric
|
||||
if(pKeyName[0] == '&')
|
||||
|
|
|
@ -9,7 +9,7 @@ class CBinds : public CComponent
|
|||
{
|
||||
char m_aaKeyBindings[KEY_LAST][128];
|
||||
|
||||
int GetKeyId(const char *pKeyName);
|
||||
int GetKeyID(const char *pKeyName);
|
||||
|
||||
static void ConBind(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConUnbind(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
|
@ -31,10 +31,10 @@ public:
|
|||
|
||||
CBindsSpecial m_SpecialBinds;
|
||||
|
||||
void Bind(int KeyId, const char *pStr);
|
||||
void Bind(int KeyID, const char *pStr);
|
||||
void SetDefaults();
|
||||
void UnbindAll();
|
||||
const char *Get(int KeyId);
|
||||
const char *Get(int KeyID);
|
||||
const char *GetKey(const char *pBindStr);
|
||||
|
||||
virtual void OnConsoleInit();
|
||||
|
|
|
@ -194,13 +194,13 @@ void CChat::OnMessage(int MsgType, void *pRawMsg)
|
|||
if(MsgType == NETMSGTYPE_SV_CHAT)
|
||||
{
|
||||
CNetMsg_Sv_Chat *pMsg = (CNetMsg_Sv_Chat *)pRawMsg;
|
||||
AddLine(pMsg->m_Cid, pMsg->m_Team, pMsg->m_pMessage);
|
||||
AddLine(pMsg->m_ClientID, pMsg->m_Team, pMsg->m_pMessage);
|
||||
}
|
||||
}
|
||||
|
||||
void CChat::AddLine(int ClientId, int Team, const char *pLine)
|
||||
void CChat::AddLine(int ClientID, int Team, const char *pLine)
|
||||
{
|
||||
if(ClientId != -1 && m_pClient->m_aClients[ClientId].m_aName[0] == '\0') // unknown client
|
||||
if(ClientID != -1 && m_pClient->m_aClients[ClientID].m_aName[0] == '\0') // unknown client
|
||||
return;
|
||||
|
||||
char *p = const_cast<char*>(pLine);
|
||||
|
@ -221,30 +221,30 @@ void CChat::AddLine(int ClientId, int Team, const char *pLine)
|
|||
m_aLines[m_CurrentLine].m_Time = time_get();
|
||||
m_aLines[m_CurrentLine].m_YOffset[0] = -1.0f;
|
||||
m_aLines[m_CurrentLine].m_YOffset[1] = -1.0f;
|
||||
m_aLines[m_CurrentLine].m_ClientId = ClientId;
|
||||
m_aLines[m_CurrentLine].m_ClientID = ClientID;
|
||||
m_aLines[m_CurrentLine].m_Team = Team;
|
||||
m_aLines[m_CurrentLine].m_NameColor = -2;
|
||||
m_aLines[m_CurrentLine].m_Highlighted = str_find_nocase(pLine, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalCid].m_aName) != 0;
|
||||
m_aLines[m_CurrentLine].m_Highlighted = str_find_nocase(pLine, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_aName) != 0;
|
||||
|
||||
if(ClientId == -1) // server message
|
||||
if(ClientID == -1) // server message
|
||||
{
|
||||
str_copy(m_aLines[m_CurrentLine].m_aName, "*** ", sizeof(m_aLines[m_CurrentLine].m_aName));
|
||||
str_format(m_aLines[m_CurrentLine].m_aText, sizeof(m_aLines[m_CurrentLine].m_aText), "%s", pLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_pClient->m_aClients[ClientId].m_Team == TEAM_SPECTATORS)
|
||||
if(m_pClient->m_aClients[ClientID].m_Team == TEAM_SPECTATORS)
|
||||
m_aLines[m_CurrentLine].m_NameColor = TEAM_SPECTATORS;
|
||||
|
||||
if(m_pClient->m_Snap.m_pGameobj && m_pClient->m_Snap.m_pGameobj->m_Flags&GAMEFLAG_TEAMS)
|
||||
{
|
||||
if(m_pClient->m_aClients[ClientId].m_Team == TEAM_RED)
|
||||
if(m_pClient->m_aClients[ClientID].m_Team == TEAM_RED)
|
||||
m_aLines[m_CurrentLine].m_NameColor = TEAM_RED;
|
||||
else if(m_pClient->m_aClients[ClientId].m_Team == TEAM_BLUE)
|
||||
else if(m_pClient->m_aClients[ClientID].m_Team == TEAM_BLUE)
|
||||
m_aLines[m_CurrentLine].m_NameColor = TEAM_BLUE;
|
||||
}
|
||||
|
||||
str_copy(m_aLines[m_CurrentLine].m_aName, m_pClient->m_aClients[ClientId].m_aName, sizeof(m_aLines[m_CurrentLine].m_aName));
|
||||
str_copy(m_aLines[m_CurrentLine].m_aName, m_pClient->m_aClients[ClientID].m_aName, sizeof(m_aLines[m_CurrentLine].m_aName));
|
||||
str_format(m_aLines[m_CurrentLine].m_aText, sizeof(m_aLines[m_CurrentLine].m_aText), ": %s", pLine);
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,7 @@ void CChat::AddLine(int ClientId, int Team, const char *pLine)
|
|||
}
|
||||
|
||||
// play sound
|
||||
if(ClientId >= 0)
|
||||
if(ClientID >= 0)
|
||||
m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_CLIENT, 0, vec2(0,0));
|
||||
else
|
||||
m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_SERVER, 0, vec2(0,0));
|
||||
|
@ -351,7 +351,7 @@ void CChat::OnRender()
|
|||
Cursor.m_LineWidth = LineWidth;
|
||||
|
||||
// render name
|
||||
if(m_aLines[r].m_ClientId == -1)
|
||||
if(m_aLines[r].m_ClientID == -1)
|
||||
TextRender()->TextColor(1.0f, 1.0f, 0.5f, Blend); // system
|
||||
else if(m_aLines[r].m_Team)
|
||||
TextRender()->TextColor(0.45f, 0.9f, 0.45f, Blend); // team message
|
||||
|
@ -367,7 +367,7 @@ void CChat::OnRender()
|
|||
TextRender()->TextEx(&Cursor, m_aLines[r].m_aName, -1);
|
||||
|
||||
// render line
|
||||
if(m_aLines[r].m_ClientId == -1)
|
||||
if(m_aLines[r].m_ClientID == -1)
|
||||
TextRender()->TextColor(1.0f, 1.0f, 0.5f, Blend); // system
|
||||
else if(m_aLines[r].m_Highlighted)
|
||||
TextRender()->TextColor(1.0f, 0.5f, 0.5f, Blend); // highlighted
|
||||
|
|
|
@ -18,7 +18,7 @@ class CChat : public CComponent
|
|||
{
|
||||
int64 m_Time;
|
||||
float m_YOffset[2];
|
||||
int m_ClientId;
|
||||
int m_ClientID;
|
||||
int m_Team;
|
||||
int m_NameColor;
|
||||
char m_aName[64];
|
||||
|
@ -57,7 +57,7 @@ public:
|
|||
|
||||
bool IsActive() const { return m_Mode != MODE_NONE; }
|
||||
|
||||
void AddLine(int ClientId, int Team, const char *pLine);
|
||||
void AddLine(int ClientID, int Team, const char *pLine);
|
||||
|
||||
void EnableMode(int Team);
|
||||
|
||||
|
|
|
@ -246,4 +246,4 @@ void CControls::ClampMousePos()
|
|||
//if(l > 0.0001f) // make sure that this isn't 0
|
||||
//camera_offset = normalize(mouse_pos)*offset_amount;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -150,17 +150,17 @@ void CEffects::PlayerSpawn(vec2 Pos)
|
|||
m_pClient->m_pSounds->Play(CSounds::CHN_WORLD, SOUND_PLAYER_SPAWN, 1.0f, Pos);
|
||||
}
|
||||
|
||||
void CEffects::PlayerDeath(vec2 Pos, int Cid)
|
||||
void CEffects::PlayerDeath(vec2 Pos, int ClientID)
|
||||
{
|
||||
vec3 BloodColor(1.0f,1.0f,1.0f);
|
||||
|
||||
if(Cid >= 0)
|
||||
if(ClientID >= 0)
|
||||
{
|
||||
if(m_pClient->m_aClients[Cid].m_UseCustomColor)
|
||||
BloodColor = m_pClient->m_pSkins->GetColorV3(m_pClient->m_aClients[Cid].m_ColorBody);
|
||||
if(m_pClient->m_aClients[ClientID].m_UseCustomColor)
|
||||
BloodColor = m_pClient->m_pSkins->GetColorV3(m_pClient->m_aClients[ClientID].m_ColorBody);
|
||||
else
|
||||
{
|
||||
const CSkins::CSkin *s = m_pClient->m_pSkins->Get(m_pClient->m_aClients[Cid].m_SkinId);
|
||||
const CSkins::CSkin *s = m_pClient->m_pSkins->Get(m_pClient->m_aClients[ClientID].m_SkinID);
|
||||
if(s)
|
||||
BloodColor = s->m_BloodColor;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
void AirJump(vec2 Pos);
|
||||
void DamageIndicator(vec2 Pos, vec2 Dir);
|
||||
void PlayerSpawn(vec2 Pos);
|
||||
void PlayerDeath(vec2 Pos, int ClientId);
|
||||
void PlayerDeath(vec2 Pos, int ClientID);
|
||||
void PowerupShine(vec2 Pos, vec2 Size);
|
||||
|
||||
void Update();
|
||||
|
|
|
@ -167,4 +167,4 @@ void CEmoticon::Emote(int Emoticon)
|
|||
CNetMsg_Cl_Emoticon Msg;
|
||||
Msg.m_Emoticon = Emoticon;
|
||||
Client()->SendPackMsg(&Msg, MSGFLAG_VITAL);
|
||||
}
|
||||
}
|
|
@ -104,7 +104,7 @@ void CGhost::OnRender()
|
|||
m_RaceState = RACE_NONE;
|
||||
}
|
||||
|
||||
CNetObj_Character Char = m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_LocalCid].m_Cur;
|
||||
CNetObj_Character Char = m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_LocalClientID].m_Cur;
|
||||
m_pClient->m_PredictedChar.Write(&Char);
|
||||
|
||||
if(m_pClient->m_NewPredictedTick)
|
||||
|
@ -280,7 +280,7 @@ void CGhost::StartRecord()
|
|||
{
|
||||
m_Recording = true;
|
||||
m_CurGhost.m_Path.clear();
|
||||
CNetObj_ClientInfo *pInfo = (CNetObj_ClientInfo *) Client()->SnapFindItem(IClient::SNAP_CURRENT, NETOBJTYPE_CLIENTINFO, m_pClient->m_Snap.m_LocalCid);
|
||||
CNetObj_ClientInfo *pInfo = (CNetObj_ClientInfo *) Client()->SnapFindItem(IClient::SNAP_CURRENT, NETOBJTYPE_CLIENTINFO, m_pClient->m_Snap.m_LocalClientID);
|
||||
m_CurGhost.m_Info = *pInfo;
|
||||
}
|
||||
|
||||
|
@ -543,7 +543,7 @@ void CGhost::OnMessage(int MsgType, void *pRawMsg)
|
|||
if(MsgType == NETMSGTYPE_SV_KILLMSG)
|
||||
{
|
||||
CNetMsg_Sv_KillMsg *pMsg = (CNetMsg_Sv_KillMsg *)pRawMsg;
|
||||
if(pMsg->m_Victim == m_pClient->m_Snap.m_LocalCid)
|
||||
if(pMsg->m_Victim == m_pClient->m_Snap.m_LocalClientID)
|
||||
{
|
||||
OnReset();
|
||||
}
|
||||
|
@ -551,7 +551,7 @@ void CGhost::OnMessage(int MsgType, void *pRawMsg)
|
|||
else if(MsgType == NETMSGTYPE_SV_CHAT)
|
||||
{
|
||||
CNetMsg_Sv_Chat *pMsg = (CNetMsg_Sv_Chat *)pRawMsg;
|
||||
if(pMsg->m_Cid == -1 && m_RaceState == RACE_STARTED)
|
||||
if(pMsg->m_ClientID == -1 && m_RaceState == RACE_STARTED)
|
||||
{
|
||||
const char* pMessage = pMsg->m_pMessage;
|
||||
|
||||
|
@ -571,7 +571,7 @@ void CGhost::OnMessage(int MsgType, void *pRawMsg)
|
|||
// prepare values and state for saving
|
||||
int Minutes;
|
||||
float Seconds;
|
||||
if(!str_comp(aName, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalCid].m_aName) && sscanf(pMessage, " finished in: %d minute(s) %f", &Minutes, &Seconds) == 2)
|
||||
if(!str_comp(aName, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_aName) && sscanf(pMessage, " finished in: %d minute(s) %f", &Minutes, &Seconds) == 2)
|
||||
{
|
||||
m_RaceState = RACE_FINISHED;
|
||||
float CurTime = Minutes*60 + Seconds;
|
||||
|
|
|
@ -135,13 +135,13 @@ void CHud::RenderScoreHud()
|
|||
else if(m_pClient->m_Snap.m_paFlags[t]->m_CarriedBy >= 0)
|
||||
{
|
||||
// draw name of the flag holder
|
||||
int Id = m_pClient->m_Snap.m_paFlags[t]->m_CarriedBy%MAX_CLIENTS;
|
||||
const char *pName = m_pClient->m_aClients[Id].m_aName;
|
||||
int ID = m_pClient->m_Snap.m_paFlags[t]->m_CarriedBy%MAX_CLIENTS;
|
||||
const char *pName = m_pClient->m_aClients[ID].m_aName;
|
||||
float w = TextRender()->TextWidth(0, 10.0f, pName, -1);
|
||||
TextRender()->Text(0, Whole-ScoreWidthMax-ImageSize-3*Split-w, 247.0f+t*20, 10.0f, pName, -1);
|
||||
|
||||
// draw tee of the flag holder
|
||||
CTeeRenderInfo Info = m_pClient->m_aClients[Id].m_RenderInfo;
|
||||
CTeeRenderInfo Info = m_pClient->m_aClients[ID].m_RenderInfo;
|
||||
Info.m_Size = 18.0f;
|
||||
RenderTools()->RenderTee(CAnimState::GetIdle(), &Info, EMOTE_NORMAL, vec2(1,0),
|
||||
vec2(Whole-ScoreWidthMax-Info.m_Size/2-Split, 246.0f+Info.m_Size/2+t*20));
|
||||
|
@ -160,7 +160,7 @@ void CHud::RenderScoreHud()
|
|||
if(m_pClient->m_Snap.m_paInfoByScore[i]->m_Team != TEAM_SPECTATORS)
|
||||
{
|
||||
apPlayerInfo[t] = m_pClient->m_Snap.m_paInfoByScore[i];
|
||||
if(apPlayerInfo[t]->m_ClientId == m_pClient->m_Snap.m_LocalCid)
|
||||
if(apPlayerInfo[t]->m_ClientID == m_pClient->m_Snap.m_LocalClientID)
|
||||
Local = t;
|
||||
++t;
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ void CHud::RenderScoreHud()
|
|||
{
|
||||
if(m_pClient->m_Snap.m_paInfoByScore[i]->m_Team != TEAM_SPECTATORS)
|
||||
++aPos[1];
|
||||
if(m_pClient->m_Snap.m_paInfoByScore[i]->m_ClientId == m_pClient->m_Snap.m_LocalCid)
|
||||
if(m_pClient->m_Snap.m_paInfoByScore[i]->m_ClientID == m_pClient->m_Snap.m_LocalClientID)
|
||||
{
|
||||
apPlayerInfo[1] = m_pClient->m_Snap.m_paInfoByScore[i];
|
||||
Local = 1;
|
||||
|
@ -211,7 +211,7 @@ void CHud::RenderScoreHud()
|
|||
// draw tee
|
||||
if(apPlayerInfo[t])
|
||||
{
|
||||
CTeeRenderInfo Info = m_pClient->m_aClients[apPlayerInfo[t]->m_ClientId].m_RenderInfo;
|
||||
CTeeRenderInfo Info = m_pClient->m_aClients[apPlayerInfo[t]->m_ClientID].m_RenderInfo;
|
||||
Info.m_Size = 18.0f;
|
||||
RenderTools()->RenderTee(CAnimState::GetIdle(), &Info, EMOTE_NORMAL, vec2(1,0),
|
||||
vec2(Whole-ScoreWidthMax-Info.m_Size/2-Split, 246.0f+Info.m_Size/2+t*20));
|
||||
|
@ -461,7 +461,7 @@ void CHud::OnMessage(int MsgType, void *pRawMsg)
|
|||
else if(MsgType == NETMSGTYPE_SV_KILLMSG)
|
||||
{
|
||||
CNetMsg_Sv_KillMsg *pMsg = (CNetMsg_Sv_KillMsg *)pRawMsg;
|
||||
if(pMsg->m_Victim == m_pClient->m_Snap.m_LocalCid)
|
||||
if(pMsg->m_Victim == m_pClient->m_Snap.m_LocalClientID)
|
||||
{
|
||||
m_CheckpointTick = 0;
|
||||
m_DDRaceTime = 0;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "items.h"
|
||||
|
||||
void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemId)
|
||||
void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemID)
|
||||
{
|
||||
|
||||
// get positions
|
||||
|
@ -70,12 +70,12 @@ void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemId)
|
|||
if(!pInfo->m_Paused)
|
||||
Time += (Client()->LocalTime()-LastLocalTime)*pInfo->m_Speed;
|
||||
|
||||
Graphics()->QuadsSetRotation(Time*pi*2*2 + ItemId);
|
||||
Graphics()->QuadsSetRotation(Time*pi*2*2 + ItemID);
|
||||
|
||||
LastLocalTime = Client()->LocalTime();
|
||||
}
|
||||
else
|
||||
Graphics()->QuadsSetRotation(Client()->LocalTime()*pi*2*2 + ItemId);
|
||||
Graphics()->QuadsSetRotation(Client()->LocalTime()*pi*2*2 + ItemID);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -175,7 +175,7 @@ void CItems::RenderFlag(const CNetObj_Flag *pPrev, const CNetObj_Flag *pCurrent)
|
|||
Pos = vec2(pCurrent->m_X, pCurrent->m_Y);
|
||||
|
||||
// make sure to use predicted position if we are the carrier
|
||||
if(m_pClient->m_Snap.m_pLocalInfo && pCurrent->m_CarriedBy == m_pClient->m_Snap.m_pLocalInfo->m_ClientId)
|
||||
if(m_pClient->m_Snap.m_pLocalInfo && pCurrent->m_CarriedBy == m_pClient->m_Snap.m_pLocalInfo->m_ClientID)
|
||||
Pos = m_pClient->m_LocalCharacterPos;
|
||||
|
||||
IGraphics::CQuadItem QuadItem(Pos.x, Pos.y-Size*0.75f, Size, Size*2);
|
||||
|
@ -262,11 +262,11 @@ void CItems::OnRender()
|
|||
|
||||
if(Item.m_Type == NETOBJTYPE_PROJECTILE)
|
||||
{
|
||||
RenderProjectile((const CNetObj_Projectile *)pData, Item.m_Id);
|
||||
RenderProjectile((const CNetObj_Projectile *)pData, Item.m_ID);
|
||||
}
|
||||
else if(Item.m_Type == NETOBJTYPE_PICKUP)
|
||||
{
|
||||
const void *pPrev = Client()->SnapFindItem(IClient::SNAP_PREV, Item.m_Type, Item.m_Id);
|
||||
const void *pPrev = Client()->SnapFindItem(IClient::SNAP_PREV, Item.m_Type, Item.m_ID);
|
||||
if(pPrev)
|
||||
RenderPickup((const CNetObj_Pickup *)pPrev, (const CNetObj_Pickup *)pData);
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ void CItems::OnRender()
|
|||
|
||||
if(Item.m_Type == NETOBJTYPE_FLAG)
|
||||
{
|
||||
const void *pPrev = Client()->SnapFindItem(IClient::SNAP_PREV, Item.m_Type, Item.m_Id);
|
||||
const void *pPrev = Client()->SnapFindItem(IClient::SNAP_PREV, Item.m_Type, Item.m_ID);
|
||||
if (pPrev)
|
||||
RenderFlag((const CNetObj_Flag *)pPrev, (const CNetObj_Flag *)pData);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
class CItems : public CComponent
|
||||
{
|
||||
void RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemId);
|
||||
void RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemID);
|
||||
void RenderPickup(const CNetObj_Pickup *pPrev, const CNetObj_Pickup *pCurrent);
|
||||
void RenderFlag(const CNetObj_Flag *pPrev, const CNetObj_Flag *pCurrent);
|
||||
void RenderLaser(const struct CNetObj_Laser *pCurrent);
|
||||
|
|
|
@ -219,4 +219,3 @@ void CMapLayers::OnRender()
|
|||
// reset the screen like it was before
|
||||
Graphics()->MapScreen(Screen.x, Screen.y, Screen.w, Screen.h);
|
||||
}
|
||||
|
||||
|
|
|
@ -552,7 +552,7 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
static int s_ServerInfoButton=0;
|
||||
if(DoButton_MenuTab(&s_ServerInfoButton, Localize("Server info"), m_ActivePage==PAGE_SERVER_INFO, &Button, CUI::CORNER_T))
|
||||
NewPage = PAGE_SERVER_INFO;
|
||||
|
||||
|
||||
if(m_pClient->m_IsRace)
|
||||
{
|
||||
Box.VSplitLeft(4.0f, 0, &Box);
|
||||
|
@ -644,7 +644,7 @@ void CMenus::RenderLoading(float Percent)
|
|||
Graphics()->QuadsEnd();
|
||||
|
||||
|
||||
const char *pCaption = Localize("Loading DDRace Client");
|
||||
const char *pCaption = Localize("Loading");
|
||||
|
||||
tw = TextRender()->TextWidth(0, 48.0f, pCaption, -1);
|
||||
CUIRect r;
|
||||
|
@ -996,7 +996,7 @@ int CMenus::Render()
|
|||
|
||||
// update download speed
|
||||
float Diff = (Client()->MapDownloadAmount()-m_DownloadLastCheckSize)/1024.0f;
|
||||
m_DownloadSpeed = (m_DownloadSpeed*(1.0f-(1.0f/m_DownloadSpeed))) + (Diff*(1.0f/m_DownloadSpeed));
|
||||
m_DownloadSpeed = absolute((m_DownloadSpeed*(1.0f-(1.0f/m_DownloadSpeed))) + (Diff*(1.0f/m_DownloadSpeed)));
|
||||
m_DownloadLastCheckTime = Now;
|
||||
m_DownloadLastCheckSize = Client()->MapDownloadAmount();
|
||||
}
|
||||
|
@ -1244,10 +1244,10 @@ void CMenus::OnRender()
|
|||
|
||||
CTextCursor cursor;
|
||||
TextRender()->SetCursor(&cursor, 10, 10, 20, TEXTFLAG_RENDER);
|
||||
TextRender()->TextEx(&cursor, "よã<EFBFBD>†ã<EFBFBD>“ã<EFBFBD><EFBFBD> - ガイド", -1);
|
||||
TextRender()->TextEx(&cursor, "ようこそ - ガイド", -1);
|
||||
|
||||
TextRender()->SetCursor(&cursor, 10, 30, 15, TEXTFLAG_RENDER);
|
||||
TextRender()->TextEx(&cursor, "よã<EFBFBD>†ã<EFBFBD>“ã<EFBFBD><EFBFBD> - ガイド", -1);
|
||||
TextRender()->TextEx(&cursor, "ようこそ - ガイド", -1);
|
||||
|
||||
//Graphics()->TextureSet(-1);
|
||||
Graphics()->QuadsBegin();
|
||||
|
|
|
@ -78,7 +78,7 @@ class CMenus : public CComponent
|
|||
CUIRect m_HitRect;
|
||||
};
|
||||
|
||||
void UiDoListboxStart(void *pId, const CUIRect *pRect, float RowHeight, const char *pTitle, const char *pBottomText, int NumItems,
|
||||
void UiDoListboxStart(void *pID, const CUIRect *pRect, float RowHeight, const char *pTitle, const char *pBottomText, int NumItems,
|
||||
int ItemsPerRow, int SelectedIndex, float ScrollValue);
|
||||
CListboxItem UiDoListboxNextItem(void *pID, bool Selected = false);
|
||||
CListboxItem UiDoListboxNextRow();
|
||||
|
@ -180,13 +180,15 @@ class CMenus : public CComponent
|
|||
m_IsDir && !Other.m_IsDir ? true : !m_IsDir && Other.m_IsDir ? false :
|
||||
str_comp_filenames(m_aFilename, Other.m_aFilename) < 0; }
|
||||
};
|
||||
|
||||
|
||||
//sorted_array<CDemoItem> m_lDemos;
|
||||
char m_aCurrentDemoFolder[256];
|
||||
int m_DemolistSelectedIndex;
|
||||
bool m_DemolistSelectedIsDir;
|
||||
int m_DemolistStorageType;
|
||||
|
||||
void DemolistOnUpdate(bool Reset);
|
||||
//void DemolistPopulate();
|
||||
static void DemolistFetchCallback(const char *pName, int IsDir, int StorageType, void *pUser);
|
||||
|
||||
static void GhostlistFetchCallback(const char *pName, int IsDir, int StorageType, void *pUser);
|
||||
|
|
|
@ -27,7 +27,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
|
||||
struct CColumn
|
||||
{
|
||||
int m_Id;
|
||||
int m_ID;
|
||||
int m_Sort;
|
||||
CLocConstString m_Caption;
|
||||
int m_Direction;
|
||||
|
@ -270,14 +270,14 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
Button.h = Row.h;
|
||||
Button.w = s_aCols[c].m_Rect.w;
|
||||
|
||||
int Id = s_aCols[c].m_Id;
|
||||
int ID = s_aCols[c].m_ID;
|
||||
|
||||
if(Id == COL_FLAG_LOCK)
|
||||
if(ID == COL_FLAG_LOCK)
|
||||
{
|
||||
if(pItem->m_Flags & SERVER_FLAG_PASSWORD)
|
||||
DoButton_Icon(IMAGE_BROWSEICONS, SPRITE_BROWSE_LOCK, &Button);
|
||||
}
|
||||
else if(Id == COL_FLAG_PURE)
|
||||
else if(ID == COL_FLAG_PURE)
|
||||
{
|
||||
if( str_comp(pItem->m_aGameType, "DM") == 0 ||
|
||||
str_comp(pItem->m_aGameType, "TDM") == 0 ||
|
||||
|
@ -291,12 +291,12 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
DoButton_Icon(IMAGE_BROWSEICONS, SPRITE_BROWSE_UNPURE, &Button);
|
||||
}
|
||||
}
|
||||
else if(Id == COL_FLAG_FAV)
|
||||
else if(ID == COL_FLAG_FAV)
|
||||
{
|
||||
if(pItem->m_Favorite)
|
||||
DoButton_Icon(IMAGE_BROWSEICONS, SPRITE_BROWSE_HEART, &Button);
|
||||
}
|
||||
else if(Id == COL_NAME)
|
||||
else if(ID == COL_NAME)
|
||||
{
|
||||
CTextCursor Cursor;
|
||||
TextRender()->SetCursor(&Cursor, Button.x, Button.y, 12.0f * UI()->Scale(), TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END);
|
||||
|
@ -305,14 +305,14 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
if(g_Config.m_BrFilterString[0] && (pItem->m_QuickSearchHit&IServerBrowser::QUICK_SERVERNAME))
|
||||
{
|
||||
// highlight the parts that matches
|
||||
const char *s = str_find_nocase(pItem->m_aName, g_Config.m_BrFilterString);
|
||||
if(s)
|
||||
const char *pStr = str_find_nocase(pItem->m_aName, g_Config.m_BrFilterString);
|
||||
if(pStr)
|
||||
{
|
||||
TextRender()->TextEx(&Cursor, pItem->m_aName, (int)(s-pItem->m_aName));
|
||||
TextRender()->TextEx(&Cursor, pItem->m_aName, (int)(pStr-pItem->m_aName));
|
||||
TextRender()->TextColor(0.4f,0.4f,1.0f,1);
|
||||
TextRender()->TextEx(&Cursor, s, str_length(g_Config.m_BrFilterString));
|
||||
TextRender()->TextEx(&Cursor, pStr, str_length(g_Config.m_BrFilterString));
|
||||
TextRender()->TextColor(1,1,1,1);
|
||||
TextRender()->TextEx(&Cursor, s+str_length(g_Config.m_BrFilterString), -1);
|
||||
TextRender()->TextEx(&Cursor, pStr+str_length(g_Config.m_BrFilterString), -1);
|
||||
}
|
||||
else
|
||||
TextRender()->TextEx(&Cursor, pItem->m_aName, -1);
|
||||
|
@ -320,14 +320,14 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
else
|
||||
TextRender()->TextEx(&Cursor, pItem->m_aName, -1);
|
||||
}
|
||||
else if(Id == COL_MAP)
|
||||
else if(ID == COL_MAP)
|
||||
{
|
||||
CTextCursor Cursor;
|
||||
TextRender()->SetCursor(&Cursor, Button.x, Button.y, 12.0f * UI()->Scale(), TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END);
|
||||
Cursor.m_LineWidth = Button.w;
|
||||
TextRender()->TextEx(&Cursor, pItem->m_aMap, -1);
|
||||
}
|
||||
else if(Id == COL_PLAYERS)
|
||||
else if(ID == COL_PLAYERS)
|
||||
{
|
||||
str_format(aTemp, sizeof(aTemp), "%i/%i", pItem->m_NumPlayers, pItem->m_MaxPlayers);
|
||||
if(g_Config.m_BrFilterString[0] && (pItem->m_QuickSearchHit&IServerBrowser::QUICK_PLAYERNAME))
|
||||
|
@ -335,17 +335,17 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
UI()->DoLabelScaled(&Button, aTemp, 12.0f, 1);
|
||||
TextRender()->TextColor(1,1,1,1);
|
||||
}
|
||||
else if(Id == COL_PING)
|
||||
else if(ID == COL_PING)
|
||||
{
|
||||
str_format(aTemp, sizeof(aTemp), "%i", pItem->m_Latency);
|
||||
UI()->DoLabelScaled(&Button, aTemp, 12.0f, 1);
|
||||
}
|
||||
else if(Id == COL_VERSION)
|
||||
else if(ID == COL_VERSION)
|
||||
{
|
||||
const char *pVersion = pItem->m_aVersion;
|
||||
UI()->DoLabelScaled(&Button, pVersion, 12.0f, 1);
|
||||
}
|
||||
else if(Id == COL_GAMETYPE)
|
||||
else if(ID == COL_GAMETYPE)
|
||||
{
|
||||
CTextCursor Cursor;
|
||||
TextRender()->SetCursor(&Cursor, Button.x, Button.y, 12.0f*UI()->Scale(), TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END);
|
||||
|
|
|
@ -28,12 +28,12 @@ int CMenus::DoButton_DemoPlayer(const void *pID, const char *pText, int Checked,
|
|||
return UI()->DoButtonLogic(pID, pText, Checked, pRect);
|
||||
}
|
||||
|
||||
int CMenus::DoButton_DemoPlayer_Sprite(const void *pID, int SpriteId, int Checked, const CUIRect *pRect)
|
||||
int CMenus::DoButton_DemoPlayer_Sprite(const void *pID, int SpriteID, int Checked, const CUIRect *pRect)
|
||||
{
|
||||
RenderTools()->DrawUIRect(pRect, vec4(1,1,1, Checked ? 0.10f : 0.5f)*ButtonColorMul(pID), CUI::CORNER_ALL, 5.0f);
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_DEMOBUTTONS].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
RenderTools()->SelectSprite(SpriteId);
|
||||
RenderTools()->SelectSprite(SpriteID);
|
||||
IGraphics::CQuadItem QuadItem(pRect->x, pRect->y, pRect->w, pRect->h);
|
||||
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
|
@ -81,8 +81,8 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
|
|||
|
||||
// do seekbar
|
||||
{
|
||||
static int s_SeekBarId = 0;
|
||||
void *id = &s_SeekBarId;
|
||||
static int s_SeekBarID = 0;
|
||||
void *id = &s_SeekBarID;
|
||||
char aBuffer[128];
|
||||
|
||||
RenderTools()->DrawUIRect(&SeekBar, vec4(0,0,0,0.5f), CUI::CORNER_ALL, 5.0f);
|
||||
|
@ -237,7 +237,7 @@ static int gs_ListBoxItemsPerRow;
|
|||
static float gs_ListBoxScrollValue;
|
||||
static bool gs_ListBoxItemActivated;
|
||||
|
||||
void CMenus::UiDoListboxStart(void *pId, const CUIRect *pRect, float RowHeight, const char *pTitle, const char *pBottomText, int NumItems,
|
||||
void CMenus::UiDoListboxStart(void *pID, const CUIRect *pRect, float RowHeight, const char *pTitle, const char *pBottomText, int NumItems,
|
||||
int ItemsPerRow, int SelectedIndex, float ScrollValue)
|
||||
{
|
||||
CUIRect Scroll, Row;
|
||||
|
@ -292,7 +292,7 @@ void CMenus::UiDoListboxStart(void *pId, const CUIRect *pRect, float RowHeight,
|
|||
}
|
||||
|
||||
Scroll.HMargin(5.0f, &Scroll);
|
||||
gs_ListBoxScrollValue = DoScrollbarV(pId, &Scroll, gs_ListBoxScrollValue);
|
||||
gs_ListBoxScrollValue = DoScrollbarV(pID, &Scroll, gs_ListBoxScrollValue);
|
||||
|
||||
// the list
|
||||
gs_ListBoxView = gs_ListBoxOriginalView;
|
||||
|
|
|
@ -691,6 +691,7 @@ void LoadLanguageIndexfile(IStorage *pStorage, IConsole *pConsole, sorted_array<
|
|||
return;
|
||||
}
|
||||
|
||||
char aOrigin[128];
|
||||
CLineReader LineReader;
|
||||
LineReader.Init(File);
|
||||
char *pLine;
|
||||
|
@ -698,7 +699,8 @@ void LoadLanguageIndexfile(IStorage *pStorage, IConsole *pConsole, sorted_array<
|
|||
{
|
||||
if(!str_length(pLine) || pLine[0] == '#') // skip empty lines and comments
|
||||
continue;
|
||||
|
||||
|
||||
str_copy(aOrigin, pLine, sizeof(aOrigin));
|
||||
char *pReplacement = LineReader.Get();
|
||||
if(!pReplacement)
|
||||
{
|
||||
|
@ -709,13 +711,13 @@ void LoadLanguageIndexfile(IStorage *pStorage, IConsole *pConsole, sorted_array<
|
|||
if(pReplacement[0] != '=' || pReplacement[1] != '=' || pReplacement[2] != ' ')
|
||||
{
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof(aBuf), "malform replacement for index '%s'", pLine);
|
||||
str_format(aBuf, sizeof(aBuf), "malform replacement for index '%s'", aOrigin);
|
||||
pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "localization", aBuf);
|
||||
continue;
|
||||
}
|
||||
|
||||
char aFileName[128];
|
||||
str_format(aFileName, sizeof(aFileName), "languages/%s.txt", pLine);
|
||||
str_format(aFileName, sizeof(aFileName), "languages/%s.txt", aOrigin);
|
||||
pLanguages->add(CLanguage(pReplacement+3, aFileName));
|
||||
}
|
||||
io_close(File);
|
||||
|
|
|
@ -29,7 +29,7 @@ void CNamePlates::RenderNameplate(
|
|||
if(g_Config.m_ClNameplatesAlways == 0)
|
||||
a = clamp(1-powf(distance(m_pClient->m_pControls->m_TargetPos, Position)/200.0f,16.0f), 0.0f, 1.0f);
|
||||
|
||||
const char *pName = m_pClient->m_aClients[pPlayerInfo->m_ClientId].m_aName;
|
||||
const char *pName = m_pClient->m_aClients[pPlayerInfo->m_ClientID].m_aName;
|
||||
float tw = TextRender()->TextWidth(0, FontSize, pName, -1);
|
||||
|
||||
TextRender()->TextColor(1.0f, 1.0f, 1.0f, a);
|
||||
|
@ -46,7 +46,7 @@ void CNamePlates::RenderNameplate(
|
|||
if(g_Config.m_Debug) // render client id when in debug aswell
|
||||
{
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof(aBuf),"%d", pPlayerInfo->m_ClientId);
|
||||
str_format(aBuf, sizeof(aBuf),"%d", pPlayerInfo->m_ClientID);
|
||||
TextRender()->Text(0, Position.x, Position.y-90, 28.0f, aBuf, -1);
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ void CPlayers::RenderHook(
|
|||
Player = *pPlayerChar;
|
||||
|
||||
CNetObj_PlayerInfo pInfo = *pPlayerInfo;
|
||||
CTeeRenderInfo RenderInfo = m_pClient->m_aClients[pInfo.m_ClientId].m_RenderInfo;
|
||||
CTeeRenderInfo RenderInfo = m_pClient->m_aClients[pInfo.m_ClientID].m_RenderInfo;
|
||||
|
||||
// check for teamplay modes
|
||||
bool IsTeamplay = false;
|
||||
|
@ -156,7 +156,7 @@ void CPlayers::RenderHook(
|
|||
|
||||
if(pPlayerChar->m_HookedPlayer != -1)
|
||||
{
|
||||
if(m_pClient->m_Snap.m_pLocalInfo && pPlayerChar->m_HookedPlayer == m_pClient->m_Snap.m_pLocalInfo->m_ClientId)
|
||||
if(m_pClient->m_Snap.m_pLocalInfo && pPlayerChar->m_HookedPlayer == m_pClient->m_Snap.m_pLocalInfo->m_ClientID)
|
||||
{
|
||||
if(Client()->State() == IClient::STATE_DEMOPLAYBACK) // only use prediction if needed
|
||||
HookPos = vec2(m_pClient->m_LocalCharacterPos.x, m_pClient->m_LocalCharacterPos.y);
|
||||
|
@ -219,7 +219,7 @@ void CPlayers::RenderPlayer(
|
|||
Player = *pPlayerChar;
|
||||
|
||||
CNetObj_PlayerInfo pInfo = *pPlayerInfo;
|
||||
CTeeRenderInfo RenderInfo = m_pClient->m_aClients[pInfo.m_ClientId].m_RenderInfo;
|
||||
CTeeRenderInfo RenderInfo = m_pClient->m_aClients[pInfo.m_ClientID].m_RenderInfo;
|
||||
|
||||
// check for teamplay modes
|
||||
bool IsTeamplay = false;
|
||||
|
@ -511,13 +511,13 @@ void CPlayers::RenderPlayer(
|
|||
Graphics()->QuadsEnd();
|
||||
}
|
||||
|
||||
if (m_pClient->m_aClients[pInfo.m_ClientId].m_EmoticonStart != -1 && m_pClient->m_aClients[pInfo.m_ClientId].m_EmoticonStart + 2 * Client()->GameTickSpeed() > Client()->GameTick())
|
||||
if (m_pClient->m_aClients[pInfo.m_ClientID].m_EmoticonStart != -1 && m_pClient->m_aClients[pInfo.m_ClientID].m_EmoticonStart + 2 * Client()->GameTickSpeed() > Client()->GameTick())
|
||||
{
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_EMOTICONS].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
|
||||
int SinceStart = Client()->GameTick() - m_pClient->m_aClients[pInfo.m_ClientId].m_EmoticonStart;
|
||||
int FromEnd = m_pClient->m_aClients[pInfo.m_ClientId].m_EmoticonStart + 2 * Client()->GameTickSpeed() - Client()->GameTick();
|
||||
int SinceStart = Client()->GameTick() - m_pClient->m_aClients[pInfo.m_ClientID].m_EmoticonStart;
|
||||
int FromEnd = m_pClient->m_aClients[pInfo.m_ClientID].m_EmoticonStart + 2 * Client()->GameTickSpeed() - Client()->GameTick();
|
||||
|
||||
float a = 1;
|
||||
|
||||
|
@ -538,7 +538,7 @@ void CPlayers::RenderPlayer(
|
|||
|
||||
Graphics()->SetColor(1.0f,1.0f,1.0f,a);
|
||||
// client_datas::emoticon is an offset from the first emoticon
|
||||
RenderTools()->SelectSprite(SPRITE_OOP + m_pClient->m_aClients[pInfo.m_ClientId].m_Emoticon);
|
||||
RenderTools()->SelectSprite(SPRITE_OOP + m_pClient->m_aClients[pInfo.m_ClientID].m_Emoticon);
|
||||
IGraphics::CQuadItem QuadItem(Position.x, Position.y - 23 - 32*h, 64, 64*h);
|
||||
Graphics()->QuadsDraw(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
|
|
|
@ -21,7 +21,7 @@ void CRaceDemo::OnRender()
|
|||
{
|
||||
if(!g_Config.m_ClAutoRaceRecord || !m_pClient->m_Snap.m_pGameobj || m_pClient->m_Snap.m_Spectate)
|
||||
{
|
||||
m_Active = m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_LocalCid].m_Active;
|
||||
m_Active = m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_LocalClientID].m_Active;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ void CRaceDemo::OnRender()
|
|||
vec2 PlayerPos = m_pClient->m_LocalCharacterPos;
|
||||
|
||||
// start the demo
|
||||
if(((!m_Active && m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_LocalCid].m_Active)) && m_DemoStartTick < Client()->GameTick())
|
||||
if(((!m_Active && m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_LocalClientID].m_Active)) && m_DemoStartTick < Client()->GameTick())
|
||||
{
|
||||
if(m_RaceState == RACE_STARTED)
|
||||
OnReset();
|
||||
|
@ -49,7 +49,7 @@ void CRaceDemo::OnRender()
|
|||
OnReset();
|
||||
}
|
||||
|
||||
m_Active = m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_LocalCid].m_Active;
|
||||
m_Active = m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_LocalClientID].m_Active;
|
||||
}
|
||||
|
||||
void CRaceDemo::OnReset()
|
||||
|
@ -90,7 +90,7 @@ void CRaceDemo::OnMessage(int MsgType, void *pRawMsg)
|
|||
if(MsgType == NETMSGTYPE_SV_KILLMSG)
|
||||
{
|
||||
CNetMsg_Sv_KillMsg *pMsg = (CNetMsg_Sv_KillMsg *)pRawMsg;
|
||||
if(pMsg->m_Victim == m_pClient->m_Snap.m_LocalCid && m_RaceState == RACE_FINISHED)
|
||||
if(pMsg->m_Victim == m_pClient->m_Snap.m_LocalClientID && m_RaceState == RACE_FINISHED)
|
||||
{
|
||||
// check for new record
|
||||
CheckDemo();
|
||||
|
@ -100,7 +100,7 @@ void CRaceDemo::OnMessage(int MsgType, void *pRawMsg)
|
|||
else if(MsgType == NETMSGTYPE_SV_CHAT)
|
||||
{
|
||||
CNetMsg_Sv_Chat *pMsg = (CNetMsg_Sv_Chat *)pRawMsg;
|
||||
if(pMsg->m_Cid == -1 && m_RaceState == RACE_STARTED)
|
||||
if(pMsg->m_ClientID == -1 && m_RaceState == RACE_STARTED)
|
||||
{
|
||||
const char* pMessage = pMsg->m_pMessage;
|
||||
|
||||
|
@ -120,7 +120,7 @@ void CRaceDemo::OnMessage(int MsgType, void *pRawMsg)
|
|||
// prepare values and state for saving
|
||||
int Minutes;
|
||||
float Seconds;
|
||||
if(!str_comp(aName, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalCid].m_aName) && sscanf(pMessage, " finished in: %d minute(s) %f", &Minutes, &Seconds) == 2)
|
||||
if(!str_comp(aName, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_aName) && sscanf(pMessage, " finished in: %d minute(s) %f", &Minutes, &Seconds) == 2)
|
||||
{
|
||||
m_RaceState = RACE_FINISHED;
|
||||
m_RecordStopTime = Client()->GameTick() + Client()->GameTickSpeed();
|
||||
|
@ -179,7 +179,7 @@ void CRaceDemo::SaveDemo(const char* pDemo)
|
|||
if(g_Config.m_ClDemoName)
|
||||
{
|
||||
char aPlayerName[MAX_NAME_LENGTH];
|
||||
str_copy(aPlayerName, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalCid].m_aName, sizeof(aPlayerName));
|
||||
str_copy(aPlayerName, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_aName, sizeof(aPlayerName));
|
||||
|
||||
// check the player name
|
||||
for(int i = 0; i < MAX_NAME_LENGTH; i++)
|
||||
|
|
|
@ -109,13 +109,13 @@ void CScoreboard::RenderSpectators(float x, float y, float w)
|
|||
if(Count)
|
||||
str_append(aBuffer, ", ", sizeof(aBuffer));
|
||||
if(m_GametypeRace)
|
||||
if (g_Config.m_ClShowIds)
|
||||
if (g_Config.m_ClShowIDs)
|
||||
{
|
||||
char aId[4];
|
||||
str_format(aId,sizeof(aId),"%d:",pInfo->m_ClientId);
|
||||
str_format(aId,sizeof(aId),"%d:",pInfo->m_ClientID);
|
||||
str_append(aBuffer, aId, sizeof(aBuffer));
|
||||
}
|
||||
str_append(aBuffer, m_pClient->m_aClients[pInfo->m_ClientId].m_aName, sizeof(aBuffer));
|
||||
str_append(aBuffer, m_pClient->m_aClients[pInfo->m_ClientID].m_aName, sizeof(aBuffer));
|
||||
Count++;
|
||||
}
|
||||
}
|
||||
|
@ -221,9 +221,9 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
|
|||
|
||||
// reset time
|
||||
if(pInfo->m_Score == -9999)
|
||||
m_pClient->m_aClients[pInfo->m_ClientId].m_Score = 0;
|
||||
m_pClient->m_aClients[pInfo->m_ClientID].m_Score = 0;
|
||||
|
||||
int Time = m_pClient->m_aClients[pInfo->m_ClientId].m_Score;
|
||||
int Time = m_pClient->m_aClients[pInfo->m_ClientID].m_Score;
|
||||
if(Time > 0)
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "%02d:%02d.%02d", Time/6000, Time/100-(Time/6000*60), Time % 100);
|
||||
|
@ -236,17 +236,17 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
|
|||
FontSizeResize = FontSize;
|
||||
|
||||
|
||||
while(TextRender()->TextWidth(0, FontSizeResize, m_pClient->m_aClients[pInfo->m_ClientId].m_aName, -1) > w-163.0f-Offset-PingWidth)
|
||||
while(TextRender()->TextWidth(0, FontSizeResize, m_pClient->m_aClients[pInfo->m_ClientID].m_aName, -1) > w-163.0f-Offset-PingWidth)
|
||||
--FontSizeResize;
|
||||
if (g_Config.m_ClShowIds)
|
||||
if (g_Config.m_ClShowIDs)
|
||||
{
|
||||
char aId[64] = "";
|
||||
str_format(aId, sizeof(aId),"%d:", pInfo->m_ClientId);
|
||||
str_append(aId, m_pClient->m_aClients[pInfo->m_ClientId].m_aName,sizeof(aId));
|
||||
str_format(aId, sizeof(aId),"%d:", pInfo->m_ClientID);
|
||||
str_append(aId, m_pClient->m_aClients[pInfo->m_ClientID].m_aName,sizeof(aId));
|
||||
TextRender()->Text(0, x+128.0f+Offset, y+(FontSize-FontSizeResize)/2, FontSizeResize, aId, -1);
|
||||
}
|
||||
else
|
||||
TextRender()->Text(0, x+128.0f+Offset, y+(FontSize-FontSizeResize)/2, FontSizeResize, m_pClient->m_aClients[pInfo->m_ClientId].m_aName, -1);
|
||||
TextRender()->Text(0, x+128.0f+Offset, y+(FontSize-FontSizeResize)/2, FontSizeResize, m_pClient->m_aClients[pInfo->m_ClientID].m_aName, -1);
|
||||
FontSizeResize = FontSize;
|
||||
str_format(aBuf, sizeof(aBuf), "%d", clamp(pInfo->m_Latency, -9999, 9999));
|
||||
while((Width = TextRender()->TextWidth(0, FontSizeResize, aBuf, -1)) > PingWidth)
|
||||
|
@ -263,9 +263,9 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
|
|||
|
||||
|
||||
FontSizeResize = FontSize;
|
||||
while(TextRender()->TextWidth(0, FontSizeResize, m_pClient->m_aClients[pInfo->m_ClientId].m_aName, -1) > w-163.0f-PingWidth)
|
||||
while(TextRender()->TextWidth(0, FontSizeResize, m_pClient->m_aClients[pInfo->m_ClientID].m_aName, -1) > w-163.0f-PingWidth)
|
||||
--FontSizeResize;
|
||||
TextRender()->Text(0, x+128.0f, y+(FontSize-FontSizeResize)/2, FontSizeResize, m_pClient->m_aClients[pInfo->m_ClientId].m_aName, -1);
|
||||
TextRender()->Text(0, x+128.0f, y+(FontSize-FontSizeResize)/2, FontSizeResize, m_pClient->m_aClients[pInfo->m_ClientID].m_aName, -1);
|
||||
FontSizeResize = FontSize;
|
||||
str_format(aBuf, sizeof(aBuf), "%d", clamp(pInfo->m_Latency, -9999, 9999));
|
||||
while((Width = TextRender()->TextWidth(0, FontSizeResize, aBuf, -1)) > PingWidth)
|
||||
|
@ -274,8 +274,8 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
|
|||
TextRender()->Text(0, x+w-35.0f-Width, y+(FontSize-FontSizeResize)/2, FontSizeResize, aBuf, -1);
|
||||
|
||||
// render avatar
|
||||
if((m_pClient->m_Snap.m_paFlags[0] && m_pClient->m_Snap.m_paFlags[0]->m_CarriedBy == pInfo->m_ClientId) ||
|
||||
(m_pClient->m_Snap.m_paFlags[1] && m_pClient->m_Snap.m_paFlags[1]->m_CarriedBy == pInfo->m_ClientId))
|
||||
if((m_pClient->m_Snap.m_paFlags[0] && m_pClient->m_Snap.m_paFlags[0]->m_CarriedBy == pInfo->m_ClientID) ||
|
||||
(m_pClient->m_Snap.m_paFlags[1] && m_pClient->m_Snap.m_paFlags[1]->m_CarriedBy == pInfo->m_ClientID))
|
||||
{
|
||||
Graphics()->BlendNormal();
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_GAME].m_Id);
|
||||
|
@ -294,7 +294,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
|
|||
Graphics()->QuadsEnd();
|
||||
}
|
||||
|
||||
CTeeRenderInfo TeeInfo = m_pClient->m_aClients[pInfo->m_ClientId].m_RenderInfo;
|
||||
CTeeRenderInfo TeeInfo = m_pClient->m_aClients[pInfo->m_ClientID].m_RenderInfo;
|
||||
TeeInfo.m_Size *= TeeSizeMod;
|
||||
|
||||
if(m_GametypeRace)
|
||||
|
|
|
@ -28,4 +28,4 @@ public:
|
|||
bool Active();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -62,7 +62,7 @@ void CSounds::Enqueue(int SetId)
|
|||
void CSounds::PlayAndRecord(int Chn, int SetId, float Vol, vec2 Pos)
|
||||
{
|
||||
CNetMsg_Sv_SoundGlobal Msg;
|
||||
Msg.m_Soundid = SetId;
|
||||
Msg.m_SoundID = SetId;
|
||||
Client()->SendPackMsg(&Msg, MSGFLAG_NOSEND|MSGFLAG_RECORD);
|
||||
|
||||
Play(Chn, SetId, Vol, Pos);
|
||||
|
|
|
@ -31,13 +31,13 @@ void CVoting::Callvote(const char *pType, const char *pValue)
|
|||
Client()->SendPackMsg(&Msg, MSGFLAG_VITAL);
|
||||
}
|
||||
|
||||
void CVoting::CallvoteKick(int ClientId, const char *pReason)
|
||||
void CVoting::CallvoteKick(int ClientID, const char *pReason)
|
||||
{
|
||||
char aBuf[32];
|
||||
if(pReason[0])
|
||||
str_format(aBuf, sizeof(aBuf), "%d %s", ClientId, pReason);
|
||||
str_format(aBuf, sizeof(aBuf), "%d %s", ClientID, pReason);
|
||||
else
|
||||
str_format(aBuf, sizeof(aBuf), "%d", ClientId);
|
||||
str_format(aBuf, sizeof(aBuf), "%d", ClientID);
|
||||
Callvote("kick", aBuf);
|
||||
}
|
||||
|
||||
|
@ -57,13 +57,13 @@ void CVoting::CallvoteOption(int OptionId)
|
|||
}
|
||||
}
|
||||
|
||||
void CVoting::ForcevoteKick(int ClientId, const char *pReason)
|
||||
void CVoting::ForcevoteKick(int ClientID, const char *pReason)
|
||||
{
|
||||
char aBuf[32];
|
||||
if(pReason[0])
|
||||
str_format(aBuf, sizeof(aBuf), "kick %d %s", ClientId, pReason);
|
||||
str_format(aBuf, sizeof(aBuf), "kick %d %s", ClientID, pReason);
|
||||
else
|
||||
str_format(aBuf, sizeof(aBuf), "kick %d", ClientId);
|
||||
str_format(aBuf, sizeof(aBuf), "kick %d", ClientID);
|
||||
Client()->Rcon(aBuf);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,9 +41,9 @@ public:
|
|||
|
||||
void RenderBars(CUIRect Bars, bool Text);
|
||||
|
||||
void CallvoteKick(int ClientId, const char *pReason);
|
||||
void CallvoteKick(int ClientID, const char *pReason);
|
||||
void CallvoteOption(int Option);
|
||||
void ForcevoteKick(int ClientId, const char *pReason);
|
||||
void ForcevoteKick(int ClientID, const char *pReason);
|
||||
void ForcevoteOption(int Option);
|
||||
|
||||
void Vote(int v); // -1 = no, 1 = yes
|
||||
|
|
|
@ -392,7 +392,7 @@ void CGameClient::OnReset()
|
|||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
m_aClients[i].m_aName[0] = 0;
|
||||
m_aClients[i].m_SkinId = 0;
|
||||
m_aClients[i].m_SkinID = 0;
|
||||
m_aClients[i].m_Team = 0;
|
||||
m_aClients[i].m_Angle = 0;
|
||||
m_aClients[i].m_Emoticon = 0;
|
||||
|
@ -489,12 +489,12 @@ void CGameClient::OnRender()
|
|||
if(m_LastSendInfo && Client()->State() == IClient::STATE_ONLINE && !m_pMenus->IsActive() && m_LastSendInfo+time_freq()*5 < time_get())
|
||||
{
|
||||
// resend if client info differs
|
||||
if(str_comp(g_Config.m_PlayerName, m_aClients[m_Snap.m_LocalCid].m_aName) ||
|
||||
str_comp(g_Config.m_PlayerSkin, m_aClients[m_Snap.m_LocalCid].m_aSkinName) ||
|
||||
if(str_comp(g_Config.m_PlayerName, m_aClients[m_Snap.m_LocalClientID].m_aName) ||
|
||||
str_comp(g_Config.m_PlayerSkin, m_aClients[m_Snap.m_LocalClientID].m_aSkinName) ||
|
||||
(g_GameClient.m_Snap.m_pGameobj && !(g_GameClient.m_Snap.m_pGameobj->m_Flags&GAMEFLAG_TEAMS) && // no teamgame?
|
||||
(g_Config.m_PlayerUseCustomColor != m_aClients[m_Snap.m_LocalCid].m_UseCustomColor ||
|
||||
g_Config.m_PlayerColorBody != m_aClients[m_Snap.m_LocalCid].m_ColorBody ||
|
||||
g_Config.m_PlayerColorFeet != m_aClients[m_Snap.m_LocalCid].m_ColorFeet)))
|
||||
(g_Config.m_PlayerUseCustomColor != m_aClients[m_Snap.m_LocalClientID].m_UseCustomColor ||
|
||||
g_Config.m_PlayerColorBody != m_aClients[m_Snap.m_LocalClientID].m_ColorBody ||
|
||||
g_Config.m_PlayerColorFeet != m_aClients[m_Snap.m_LocalClientID].m_ColorFeet)))
|
||||
{
|
||||
SendInfo(false);
|
||||
}
|
||||
|
@ -577,8 +577,8 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker)
|
|||
CNetMsg_Sv_Emoticon *pMsg = (CNetMsg_Sv_Emoticon *)pRawMsg;
|
||||
|
||||
// apply
|
||||
m_aClients[pMsg->m_Cid].m_Emoticon = pMsg->m_Emoticon;
|
||||
m_aClients[pMsg->m_Cid].m_EmoticonStart = Client()->GameTick();
|
||||
m_aClients[pMsg->m_ClientID].m_Emoticon = pMsg->m_Emoticon;
|
||||
m_aClients[pMsg->m_ClientID].m_EmoticonStart = Client()->GameTick();
|
||||
}
|
||||
else if(MsgId == NETMSGTYPE_SV_SOUNDGLOBAL)
|
||||
{
|
||||
|
@ -587,12 +587,12 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker)
|
|||
|
||||
// don't enqueue pseudo-global sounds from demos (created by PlayAndRecord)
|
||||
CNetMsg_Sv_SoundGlobal *pMsg = (CNetMsg_Sv_SoundGlobal *)pRawMsg;
|
||||
if(pMsg->m_Soundid == SOUND_CTF_DROP || pMsg->m_Soundid == SOUND_CTF_RETURN ||
|
||||
pMsg->m_Soundid == SOUND_CTF_CAPTURE || pMsg->m_Soundid == SOUND_CTF_GRAB_EN ||
|
||||
pMsg->m_Soundid == SOUND_CTF_GRAB_PL)
|
||||
g_GameClient.m_pSounds->Enqueue(pMsg->m_Soundid);
|
||||
if(pMsg->m_SoundID == SOUND_CTF_DROP || pMsg->m_SoundID == SOUND_CTF_RETURN ||
|
||||
pMsg->m_SoundID == SOUND_CTF_CAPTURE || pMsg->m_SoundID == SOUND_CTF_GRAB_EN ||
|
||||
pMsg->m_SoundID == SOUND_CTF_GRAB_PL)
|
||||
g_GameClient.m_pSounds->Enqueue(pMsg->m_SoundID);
|
||||
else
|
||||
g_GameClient.m_pSounds->Play(CSounds::CHN_GLOBAL, pMsg->m_Soundid, 1.0f, vec2(0,0));
|
||||
g_GameClient.m_pSounds->Play(CSounds::CHN_GLOBAL, pMsg->m_SoundID, 1.0f, vec2(0,0));
|
||||
}
|
||||
else if(MsgId == NETMSGTYPE_CL_TEAMSSTATE)
|
||||
{
|
||||
|
@ -619,7 +619,7 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker)
|
|||
else if(MsgId == NETMSGTYPE_SV_PLAYERTIME)
|
||||
{
|
||||
CNetMsg_Sv_PlayerTime *pMsg = (CNetMsg_Sv_PlayerTime *)pRawMsg;
|
||||
m_aClients[pMsg->m_Cid].m_Score = pMsg->m_Time;
|
||||
m_aClients[pMsg->m_ClientID].m_Score = pMsg->m_Time;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -693,12 +693,12 @@ void CGameClient::ProcessEvents()
|
|||
else if(Item.m_Type == NETEVENTTYPE_DEATH)
|
||||
{
|
||||
NETEVENT_DEATH *ev = (NETEVENT_DEATH *)pData;
|
||||
g_GameClient.m_pEffects->PlayerDeath(vec2(ev->m_X, ev->m_Y), ev->m_ClientId);
|
||||
g_GameClient.m_pEffects->PlayerDeath(vec2(ev->m_X, ev->m_Y), ev->m_ClientID);
|
||||
}
|
||||
else if(Item.m_Type == NETEVENTTYPE_SOUNDWORLD)
|
||||
{
|
||||
NETEVENT_SOUNDWORLD *ev = (NETEVENT_SOUNDWORLD *)pData;
|
||||
g_GameClient.m_pSounds->Play(CSounds::CHN_WORLD, ev->m_SoundId, 1.0f, vec2(ev->m_X, ev->m_Y));
|
||||
g_GameClient.m_pSounds->Play(CSounds::CHN_WORLD, ev->m_SoundID, 1.0f, vec2(ev->m_X, ev->m_Y));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -709,7 +709,7 @@ void CGameClient::OnNewSnapshot()
|
|||
|
||||
// clear out the invalid pointers
|
||||
mem_zero(&g_GameClient.m_Snap, sizeof(g_GameClient.m_Snap));
|
||||
m_Snap.m_LocalCid = -1;
|
||||
m_Snap.m_LocalClientID = -1;
|
||||
|
||||
// secure snapshot
|
||||
{
|
||||
|
@ -723,7 +723,7 @@ void CGameClient::OnNewSnapshot()
|
|||
if(g_Config.m_Debug)
|
||||
{
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), "invalidated index=%d type=%d (%s) size=%d id=%d", Index, Item.m_Type, m_NetObjHandler.GetObjName(Item.m_Type), Item.m_DataSize, Item.m_Id);
|
||||
str_format(aBuf, sizeof(aBuf), "invalidated index=%d type=%d (%s) size=%d id=%d", Index, Item.m_Type, m_NetObjHandler.GetObjName(Item.m_Type), Item.m_DataSize, Item.m_ID);
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "game", aBuf);
|
||||
}
|
||||
Client()->SnapInvalidateItem(IClient::SNAP_CURRENT, Index);
|
||||
|
@ -763,41 +763,41 @@ void CGameClient::OnNewSnapshot()
|
|||
if(Item.m_Type == NETOBJTYPE_CLIENTINFO)
|
||||
{
|
||||
const CNetObj_ClientInfo *pInfo = (const CNetObj_ClientInfo *)pData;
|
||||
int Cid = Item.m_Id;
|
||||
IntsToStr(&pInfo->m_Name0, 6, m_aClients[Cid].m_aName);
|
||||
IntsToStr(&pInfo->m_Skin0, 6, m_aClients[Cid].m_aSkinName);
|
||||
int ClientID = Item.m_ID;
|
||||
IntsToStr(&pInfo->m_Name0, 6, m_aClients[ClientID].m_aName);
|
||||
IntsToStr(&pInfo->m_Skin0, 6, m_aClients[ClientID].m_aSkinName);
|
||||
|
||||
m_aClients[Cid].m_UseCustomColor = pInfo->m_UseCustomColor;
|
||||
m_aClients[Cid].m_ColorBody = pInfo->m_ColorBody;
|
||||
m_aClients[Cid].m_ColorFeet = pInfo->m_ColorFeet;
|
||||
m_aClients[ClientID].m_UseCustomColor = pInfo->m_UseCustomColor;
|
||||
m_aClients[ClientID].m_ColorBody = pInfo->m_ColorBody;
|
||||
m_aClients[ClientID].m_ColorFeet = pInfo->m_ColorFeet;
|
||||
|
||||
// prepare the info
|
||||
if(m_aClients[Cid].m_aSkinName[0] == 'x' || m_aClients[Cid].m_aSkinName[1] == '_')
|
||||
str_copy(m_aClients[Cid].m_aSkinName, "default", 64);
|
||||
if(m_aClients[ClientID].m_aSkinName[0] == 'x' || m_aClients[ClientID].m_aSkinName[1] == '_')
|
||||
str_copy(m_aClients[ClientID].m_aSkinName, "default", 64);
|
||||
|
||||
m_aClients[Cid].m_SkinInfo.m_ColorBody = m_pSkins->GetColorV4(m_aClients[Cid].m_ColorBody);
|
||||
m_aClients[Cid].m_SkinInfo.m_ColorFeet = m_pSkins->GetColorV4(m_aClients[Cid].m_ColorFeet);
|
||||
m_aClients[Cid].m_SkinInfo.m_Size = 64;
|
||||
m_aClients[ClientID].m_SkinInfo.m_ColorBody = m_pSkins->GetColorV4(m_aClients[ClientID].m_ColorBody);
|
||||
m_aClients[ClientID].m_SkinInfo.m_ColorFeet = m_pSkins->GetColorV4(m_aClients[ClientID].m_ColorFeet);
|
||||
m_aClients[ClientID].m_SkinInfo.m_Size = 64;
|
||||
|
||||
// find new skin
|
||||
m_aClients[Cid].m_SkinId = g_GameClient.m_pSkins->Find(m_aClients[Cid].m_aSkinName);
|
||||
if(m_aClients[Cid].m_SkinId < 0)
|
||||
m_aClients[ClientID].m_SkinID = g_GameClient.m_pSkins->Find(m_aClients[ClientID].m_aSkinName);
|
||||
if(m_aClients[ClientID].m_SkinID < 0)
|
||||
{
|
||||
m_aClients[Cid].m_SkinId = g_GameClient.m_pSkins->Find("default");
|
||||
if(m_aClients[Cid].m_SkinId < 0)
|
||||
m_aClients[Cid].m_SkinId = 0;
|
||||
m_aClients[ClientID].m_SkinID = g_GameClient.m_pSkins->Find("default");
|
||||
if(m_aClients[ClientID].m_SkinID < 0)
|
||||
m_aClients[ClientID].m_SkinID = 0;
|
||||
}
|
||||
|
||||
if(m_aClients[Cid].m_UseCustomColor)
|
||||
m_aClients[Cid].m_SkinInfo.m_Texture = g_GameClient.m_pSkins->Get(m_aClients[Cid].m_SkinId)->m_ColorTexture;
|
||||
if(m_aClients[ClientID].m_UseCustomColor)
|
||||
m_aClients[ClientID].m_SkinInfo.m_Texture = g_GameClient.m_pSkins->Get(m_aClients[ClientID].m_SkinID)->m_ColorTexture;
|
||||
else
|
||||
{
|
||||
m_aClients[Cid].m_SkinInfo.m_Texture = g_GameClient.m_pSkins->Get(m_aClients[Cid].m_SkinId)->m_OrgTexture;
|
||||
m_aClients[Cid].m_SkinInfo.m_ColorBody = vec4(1,1,1,1);
|
||||
m_aClients[Cid].m_SkinInfo.m_ColorFeet = vec4(1,1,1,1);
|
||||
m_aClients[ClientID].m_SkinInfo.m_Texture = g_GameClient.m_pSkins->Get(m_aClients[ClientID].m_SkinID)->m_OrgTexture;
|
||||
m_aClients[ClientID].m_SkinInfo.m_ColorBody = vec4(1,1,1,1);
|
||||
m_aClients[ClientID].m_SkinInfo.m_ColorFeet = vec4(1,1,1,1);
|
||||
}
|
||||
|
||||
m_aClients[Cid].UpdateRenderInfo();
|
||||
m_aClients[ClientID].UpdateRenderInfo();
|
||||
g_GameClient.m_Snap.m_NumPlayers++;
|
||||
|
||||
}
|
||||
|
@ -805,12 +805,12 @@ void CGameClient::OnNewSnapshot()
|
|||
{
|
||||
const CNetObj_PlayerInfo *pInfo = (const CNetObj_PlayerInfo *)pData;
|
||||
|
||||
m_aClients[pInfo->m_ClientId].m_Team = pInfo->m_Team;
|
||||
m_Snap.m_paPlayerInfos[pInfo->m_ClientId] = pInfo;
|
||||
m_aClients[pInfo->m_ClientID].m_Team = pInfo->m_Team;
|
||||
m_Snap.m_paPlayerInfos[pInfo->m_ClientID] = pInfo;
|
||||
|
||||
if(pInfo->m_Local)
|
||||
{
|
||||
m_Snap.m_LocalCid = Item.m_Id;
|
||||
m_Snap.m_LocalClientID = Item.m_ID;
|
||||
m_Snap.m_pLocalInfo = pInfo;
|
||||
|
||||
if(pInfo->m_Team == TEAM_SPECTATORS)
|
||||
|
@ -824,17 +824,17 @@ void CGameClient::OnNewSnapshot()
|
|||
}
|
||||
else if(Item.m_Type == NETOBJTYPE_CHARACTER)
|
||||
{
|
||||
const void *pOld = Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_CHARACTER, Item.m_Id);
|
||||
const void *pOld = Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_CHARACTER, Item.m_ID);
|
||||
if(pOld)
|
||||
{
|
||||
m_Snap.m_aCharacters[Item.m_Id].m_Active = true;
|
||||
m_Snap.m_aCharacters[Item.m_Id].m_Prev = *((const CNetObj_Character *)pOld);
|
||||
m_Snap.m_aCharacters[Item.m_Id].m_Cur = *((const CNetObj_Character *)pData);
|
||||
m_Snap.m_aCharacters[Item.m_ID].m_Active = true;
|
||||
m_Snap.m_aCharacters[Item.m_ID].m_Prev = *((const CNetObj_Character *)pOld);
|
||||
m_Snap.m_aCharacters[Item.m_ID].m_Cur = *((const CNetObj_Character *)pData);
|
||||
|
||||
if(m_Snap.m_aCharacters[Item.m_Id].m_Prev.m_Tick)
|
||||
Evolve(&m_Snap.m_aCharacters[Item.m_Id].m_Prev, Client()->PrevGameTick());
|
||||
if(m_Snap.m_aCharacters[Item.m_Id].m_Cur.m_Tick)
|
||||
Evolve(&m_Snap.m_aCharacters[Item.m_Id].m_Cur, Client()->GameTick());
|
||||
if(m_Snap.m_aCharacters[Item.m_ID].m_Prev.m_Tick)
|
||||
Evolve(&m_Snap.m_aCharacters[Item.m_ID].m_Prev, Client()->PrevGameTick());
|
||||
if(m_Snap.m_aCharacters[Item.m_ID].m_Cur.m_Tick)
|
||||
Evolve(&m_Snap.m_aCharacters[Item.m_ID].m_Cur, Client()->GameTick());
|
||||
}
|
||||
}
|
||||
else if(Item.m_Type == NETOBJTYPE_GAME)
|
||||
|
@ -848,21 +848,21 @@ void CGameClient::OnNewSnapshot()
|
|||
s_GameOver = m_Snap.m_pGameobj->m_GameOver;
|
||||
}
|
||||
else if(Item.m_Type == NETOBJTYPE_FLAG)
|
||||
m_Snap.m_paFlags[Item.m_Id%2] = (const CNetObj_Flag *)pData;
|
||||
m_Snap.m_paFlags[Item.m_ID%2] = (const CNetObj_Flag *)pData;
|
||||
}
|
||||
}
|
||||
|
||||
// setup local pointers
|
||||
if(m_Snap.m_LocalCid >= 0)
|
||||
if(m_Snap.m_LocalClientID >= 0)
|
||||
{
|
||||
CSnapState::CCharacterInfo *c = &m_Snap.m_aCharacters[m_Snap.m_LocalCid];
|
||||
CSnapState::CCharacterInfo *c = &m_Snap.m_aCharacters[m_Snap.m_LocalClientID];
|
||||
if(c->m_Active)
|
||||
{
|
||||
m_Snap.m_pLocalCharacter = &c->m_Cur;
|
||||
m_Snap.m_pLocalPrevCharacter = &c->m_Prev;
|
||||
m_LocalCharacterPos = vec2(m_Snap.m_pLocalCharacter->m_X, m_Snap.m_pLocalCharacter->m_Y);
|
||||
}
|
||||
else if(Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_CHARACTER, m_Snap.m_LocalCid))
|
||||
else if(Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_CHARACTER, m_Snap.m_LocalClientID))
|
||||
{
|
||||
// player died
|
||||
m_pControls->OnPlayerDeath();
|
||||
|
@ -917,7 +917,7 @@ void CGameClient::OnPredict()
|
|||
CCharacterCore BeforeChar = m_PredictedChar;
|
||||
|
||||
// we can't predict without our own id or own character
|
||||
if(m_Snap.m_LocalCid == -1 || !m_Snap.m_aCharacters[m_Snap.m_LocalCid].m_Active)
|
||||
if(m_Snap.m_LocalClientID == -1 || !m_Snap.m_aCharacters[m_Snap.m_LocalClientID].m_Active)
|
||||
return;
|
||||
|
||||
// don't predict anything if we are paused
|
||||
|
@ -942,7 +942,7 @@ void CGameClient::OnPredict()
|
|||
|
||||
g_GameClient.m_aClients[i].m_Predicted.Init(&World, Collision(), &m_Teams);
|
||||
World.m_apCharacters[i] = &g_GameClient.m_aClients[i].m_Predicted;
|
||||
World.m_apCharacters[i]->m_Id = m_Snap.m_paPlayerInfos[i]->m_ClientId;
|
||||
World.m_apCharacters[i]->m_Id = m_Snap.m_paPlayerInfos[i]->m_ClientID;
|
||||
g_GameClient.m_aClients[i].m_Predicted.Read(&m_Snap.m_aCharacters[i].m_Cur);
|
||||
}
|
||||
|
||||
|
@ -950,8 +950,8 @@ void CGameClient::OnPredict()
|
|||
for(int Tick = Client()->GameTick()+1; Tick <= Client()->PredGameTick(); Tick++)
|
||||
{
|
||||
// fetch the local
|
||||
if(Tick == Client()->PredGameTick() && World.m_apCharacters[m_Snap.m_LocalCid])
|
||||
m_PredictedPrevChar = *World.m_apCharacters[m_Snap.m_LocalCid];
|
||||
if(Tick == Client()->PredGameTick() && World.m_apCharacters[m_Snap.m_LocalClientID])
|
||||
m_PredictedPrevChar = *World.m_apCharacters[m_Snap.m_LocalClientID];
|
||||
|
||||
// first calculate where everyone should move
|
||||
for(int c = 0; c < MAX_CLIENTS; c++)
|
||||
|
@ -960,7 +960,7 @@ void CGameClient::OnPredict()
|
|||
continue;
|
||||
|
||||
mem_zero(&World.m_apCharacters[c]->m_Input, sizeof(World.m_apCharacters[c]->m_Input));
|
||||
if(m_Snap.m_LocalCid == c)
|
||||
if(m_Snap.m_LocalClientID == c)
|
||||
{
|
||||
// apply player input
|
||||
int *pInput = Client()->GetInput(Tick);
|
||||
|
@ -989,10 +989,10 @@ void CGameClient::OnPredict()
|
|||
m_LastNewPredictedTick = Tick;
|
||||
m_NewPredictedTick = true;
|
||||
|
||||
if(m_Snap.m_LocalCid != -1 && World.m_apCharacters[m_Snap.m_LocalCid])
|
||||
if(m_Snap.m_LocalClientID != -1 && World.m_apCharacters[m_Snap.m_LocalClientID])
|
||||
{
|
||||
vec2 Pos = World.m_apCharacters[m_Snap.m_LocalCid]->m_Pos;
|
||||
int Events = World.m_apCharacters[m_Snap.m_LocalCid]->m_TriggeredEvents;
|
||||
vec2 Pos = World.m_apCharacters[m_Snap.m_LocalClientID]->m_Pos;
|
||||
int Events = World.m_apCharacters[m_Snap.m_LocalClientID]->m_TriggeredEvents;
|
||||
if(Events&COREEVENT_GROUND_JUMP) g_GameClient.m_pSounds->PlayAndRecord(CSounds::CHN_WORLD, SOUND_PLAYER_JUMP, 1.0f, Pos);
|
||||
|
||||
/*if(events&COREEVENT_AIR_JUMP)
|
||||
|
@ -1009,8 +1009,8 @@ void CGameClient::OnPredict()
|
|||
}
|
||||
}
|
||||
|
||||
if(Tick == Client()->PredGameTick() && World.m_apCharacters[m_Snap.m_LocalCid])
|
||||
m_PredictedChar = *World.m_apCharacters[m_Snap.m_LocalCid];
|
||||
if(Tick == Client()->PredGameTick() && World.m_apCharacters[m_Snap.m_LocalClientID])
|
||||
m_PredictedChar = *World.m_apCharacters[m_Snap.m_LocalClientID];
|
||||
}
|
||||
|
||||
if(g_Config.m_Debug && g_Config.m_ClPredict && m_PredictedTick == Client()->PredGameTick())
|
||||
|
@ -1052,7 +1052,7 @@ void CGameClient::CClientData::UpdateRenderInfo()
|
|||
const int TeamColors[2] = {65387, 10223467};
|
||||
if(m_Team >= TEAM_RED && m_Team <= TEAM_BLUE)
|
||||
{
|
||||
m_RenderInfo.m_Texture = g_GameClient.m_pSkins->Get(m_SkinId)->m_ColorTexture;
|
||||
m_RenderInfo.m_Texture = g_GameClient.m_pSkins->Get(m_SkinID)->m_ColorTexture;
|
||||
m_RenderInfo.m_ColorBody = g_GameClient.m_pSkins->GetColorV4(TeamColors[m_Team]);
|
||||
m_RenderInfo.m_ColorFeet = g_GameClient.m_pSkins->GetColorV4(TeamColors[m_Team]);
|
||||
}
|
||||
|
@ -1094,7 +1094,7 @@ void CGameClient::SendInfo(bool Start)
|
|||
}
|
||||
}
|
||||
|
||||
void CGameClient::SendKill(int ClientId)
|
||||
void CGameClient::SendKill(int ClientID)
|
||||
{
|
||||
CNetMsg_Cl_Kill Msg;
|
||||
Client()->SendPackMsg(&Msg, MSGFLAG_VITAL);
|
||||
|
|
|
@ -117,7 +117,7 @@ public:
|
|||
const CNetObj_PlayerInfo *m_paPlayerInfos[MAX_CLIENTS];
|
||||
const CNetObj_PlayerInfo *m_paInfoByScore[MAX_CLIENTS];
|
||||
|
||||
int m_LocalCid;
|
||||
int m_LocalClientID;
|
||||
int m_NumPlayers;
|
||||
int m_aTeamSize[2];
|
||||
bool m_Spectate;
|
||||
|
@ -149,7 +149,7 @@ public:
|
|||
|
||||
char m_aName[64];
|
||||
char m_aSkinName[64];
|
||||
int m_SkinId;
|
||||
int m_SkinID;
|
||||
int m_SkinColor;
|
||||
int m_Team;
|
||||
int m_Emoticon;
|
||||
|
@ -199,7 +199,7 @@ public:
|
|||
// TODO: move these
|
||||
void SendSwitchTeam(int Team);
|
||||
void SendInfo(bool Start);
|
||||
void SendKill(int ClientId);
|
||||
void SendKill(int ClientID);
|
||||
|
||||
// pointers to all systems
|
||||
class CGameConsole *m_pGameConsole;
|
||||
|
|
|
@ -165,21 +165,21 @@ void CCollision::Init(class CLayers *pLayers)
|
|||
}
|
||||
}
|
||||
|
||||
int CCollision::GetTile(int x, int y)
|
||||
int CCollision::GetTile(int X, int Y)
|
||||
{
|
||||
int nx = clamp(x/32, 0, m_Width-1);
|
||||
int ny = clamp(y/32, 0, m_Height-1);
|
||||
if(!m_pTiles || ny < 0 || nx < 0)
|
||||
int Nx = clamp(X/32, 0, m_Width-1);
|
||||
int Ny = clamp(Y/32, 0, m_Height-1);
|
||||
if(!m_pTiles || Ny < 0 || Nx < 0)
|
||||
{
|
||||
//dbg_msg("Collision","Something is terribly wrong, !m_pTiles %d, ny %d, ny %d", !m_pTiles, ny, ny);
|
||||
//dbg_msg("Collision","Something is terribly wrong, !m_pTiles %d, Ny %d, Ny %d", !m_pTiles, Ny, Ny);
|
||||
return 0;
|
||||
}
|
||||
/*dbg_msg("GetTile","m_Index %d",m_pTiles[ny*m_Width+nx].m_Index);//Remove */
|
||||
if(m_pTiles[ny*m_Width+nx].m_Index == COLFLAG_SOLID
|
||||
|| m_pTiles[ny*m_Width+nx].m_Index == (COLFLAG_SOLID|COLFLAG_NOHOOK)
|
||||
|| m_pTiles[ny*m_Width+nx].m_Index == COLFLAG_DEATH
|
||||
|| m_pTiles[ny*m_Width+nx].m_Index == COLFLAG_NOLASER)
|
||||
return m_pTiles[ny*m_Width+nx].m_Index;
|
||||
/*dbg_msg("GetTile","m_Index %d",m_pTiles[Ny*m_Width+Nx].m_Index);//Remove */
|
||||
if(m_pTiles[Ny*m_Width+Nx].m_Index == COLFLAG_SOLID
|
||||
|| m_pTiles[Ny*m_Width+Nx].m_Index == (COLFLAG_SOLID|COLFLAG_NOHOOK)
|
||||
|| m_pTiles[Ny*m_Width+Nx].m_Index == COLFLAG_DEATH
|
||||
|| m_pTiles[Ny*m_Width+Nx].m_Index == COLFLAG_NOLASER)
|
||||
return m_pTiles[Ny*m_Width+Nx].m_Index;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
@ -187,14 +187,14 @@ int CCollision::GetTile(int x, int y)
|
|||
/*
|
||||
bool CCollision::IsTileSolid(int x, int y)
|
||||
{
|
||||
return GetTile(x,y)&COLFLAG_SOLID;
|
||||
return GetTile(X, Y)&COLFLAG_SOLID;
|
||||
}
|
||||
*/
|
||||
|
||||
int CCollision::IntersectLine(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision, bool AllowThrough)
|
||||
{
|
||||
float d = distance(Pos0, Pos1);
|
||||
int End(d+1);
|
||||
float D = distance(Pos0, Pos1);
|
||||
int End(D+1);
|
||||
vec2 Last = Pos0;
|
||||
int ix = 0, iy = 0; // Temporary position for checking collision
|
||||
int dx = 0, dy = 0; // Offset for checking the "through" tile
|
||||
|
@ -204,8 +204,8 @@ int CCollision::IntersectLine(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *p
|
|||
}
|
||||
for(int i = 0; i < End; i++)
|
||||
{
|
||||
float a = i/d;
|
||||
vec2 Pos = mix(Pos0, Pos1, a);
|
||||
float A = i/D;
|
||||
vec2 Pos = mix(Pos0, Pos1, A);
|
||||
ix = round(Pos.x);
|
||||
iy = round(Pos.y);
|
||||
if(CheckPoint(ix, iy) && !(AllowThrough && IsThrough(ix + dx, iy + dy)))
|
||||
|
@ -343,12 +343,12 @@ int CCollision::IsSolid(int x, int y)
|
|||
|
||||
int CCollision::IsThrough(int x, int y)
|
||||
{
|
||||
int nx = clamp(x/32, 0, m_Width-1);
|
||||
int ny = clamp(y/32, 0, m_Height-1);
|
||||
int Index = m_pTiles[ny*m_Width+nx].m_Index;
|
||||
int Nx = clamp(x/32, 0, m_Width-1);
|
||||
int Ny = clamp(y/32, 0, m_Height-1);
|
||||
int Index = m_pTiles[Ny*m_Width+Nx].m_Index;
|
||||
int Findex = 0;
|
||||
if (m_pFront)
|
||||
Findex = m_pFront[ny*m_Width+nx].m_Index;
|
||||
Findex = m_pFront[Ny*m_Width+Nx].m_Index;
|
||||
if (Index == TILE_THROUGH)
|
||||
return Index;
|
||||
else if (Findex == TILE_THROUGH)
|
||||
|
@ -452,10 +452,10 @@ int CCollision::GetSwitchDelay(int Index)
|
|||
|
||||
int CCollision::IsMover(int x, int y, int* Flags)
|
||||
{
|
||||
int nx = clamp(x/32, 0, m_Width-1);
|
||||
int ny = clamp(y/32, 0, m_Height-1);
|
||||
int Index = m_pTiles[ny*m_Width+nx].m_Index;
|
||||
*Flags = m_pTiles[ny*m_Width+nx].m_Flags;
|
||||
int Nx = clamp(x/32, 0, m_Width-1);
|
||||
int Ny = clamp(y/32, 0, m_Height-1);
|
||||
int Index = m_pTiles[Ny*m_Width+Nx].m_Index;
|
||||
*Flags = m_pTiles[Ny*m_Width+Nx].m_Flags;
|
||||
if(Index < 0)
|
||||
return 0;
|
||||
if (Index == TILE_CP || Index == TILE_CP_F)
|
||||
|
@ -521,9 +521,9 @@ vec2 CCollision::CpSpeed(int Index, int Flags)
|
|||
|
||||
int CCollision::GetPureMapIndex(vec2 Pos)
|
||||
{
|
||||
int nx = clamp((int)Pos.x/32, 0, m_Width-1);
|
||||
int ny = clamp((int)Pos.y/32, 0, m_Height-1);
|
||||
return ny*m_Width+nx;
|
||||
int Nx = clamp((int)Pos.x/32, 0, m_Width-1);
|
||||
int Ny = clamp((int)Pos.y/32, 0, m_Height-1);
|
||||
return Ny*m_Width+Nx;
|
||||
}
|
||||
|
||||
bool CCollision::TileExists(int Index)
|
||||
|
@ -590,9 +590,9 @@ bool CCollision::TileExistsNext(int Index)
|
|||
|
||||
int CCollision::GetMapIndex(vec2 Pos)
|
||||
{
|
||||
int nx = clamp((int)Pos.x / 32, 0, m_Width - 1);
|
||||
int ny = clamp((int)Pos.y / 32, 0, m_Height - 1);
|
||||
int Index = ny*m_Width+nx;
|
||||
int Nx = clamp((int)Pos.x / 32, 0, m_Width - 1);
|
||||
int Ny = clamp((int)Pos.y / 32, 0, m_Height - 1);
|
||||
int Index = Ny*m_Width+Nx;
|
||||
/*if (m_pTele && (m_pTele[Index].m_Type == TILE_TELEIN)) dbg_msg("m_pTele && TELEIN","Index %d",Index);
|
||||
else if (m_pTele && m_pTele[Index].m_Type==TILE_TELEOUT) dbg_msg("TELEOUT","Index %d",Index);
|
||||
else dbg_msg("GetMapIndex(","Index %d",Index);//REMOVE */
|
||||
|
@ -610,9 +610,9 @@ std::list<int> CCollision::GetMapIndices(vec2 PrevPos, vec2 Pos, unsigned MaxInd
|
|||
int End(d + 1);
|
||||
if(!d)
|
||||
{
|
||||
int nx = clamp((int)Pos.x / 32, 0, m_Width - 1);
|
||||
int ny = clamp((int)Pos.y / 32, 0, m_Height - 1);
|
||||
int Index = ny * m_Width + nx;
|
||||
int Nx = clamp((int)Pos.x / 32, 0, m_Width - 1);
|
||||
int Ny = clamp((int)Pos.y / 32, 0, m_Height - 1);
|
||||
int Index = Ny * m_Width + Nx;
|
||||
/*if (m_pTele && (m_pTele[Index].m_Type == TILE_TELEIN)) dbg_msg("m_pTele && TELEIN","Index %d",Index);
|
||||
else if (m_pTele && m_pTele[Index].m_Type==TILE_TELEOUT) dbg_msg("TELEOUT","Index %d",Index);
|
||||
else dbg_msg("GetMapIndex(","Index %d",Index);//REMOVE */
|
||||
|
@ -629,16 +629,16 @@ std::list<int> CCollision::GetMapIndices(vec2 PrevPos, vec2 Pos, unsigned MaxInd
|
|||
{
|
||||
float a = 0.0f;
|
||||
vec2 Tmp = vec2(0, 0);
|
||||
int nx = 0;
|
||||
int ny = 0;
|
||||
int Nx = 0;
|
||||
int Ny = 0;
|
||||
int Index,LastIndex = 0;
|
||||
for(int i = 0; i < End; i++)
|
||||
{
|
||||
a = i/d;
|
||||
Tmp = mix(PrevPos, Pos, a);
|
||||
nx = clamp((int)Tmp.x / 32, 0, m_Width - 1);
|
||||
ny = clamp((int)Tmp.y / 32, 0, m_Height - 1);
|
||||
Index = ny * m_Width + nx;
|
||||
Nx = clamp((int)Tmp.x / 32, 0, m_Width - 1);
|
||||
Ny = clamp((int)Tmp.y / 32, 0, m_Height - 1);
|
||||
Index = Ny * m_Width + Nx;
|
||||
//dbg_msg("lastindex","%d",LastIndex);
|
||||
//dbg_msg("index","%d",Index);
|
||||
if(TileExists(Index) && LastIndex != Index)
|
||||
|
@ -699,27 +699,27 @@ int CCollision::GetFTileFlags(int Index)
|
|||
return m_pFront[Index].m_Flags;
|
||||
}
|
||||
|
||||
int CCollision::GetIndex(int nx, int ny)
|
||||
int CCollision::GetIndex(int Nx, int Ny)
|
||||
{
|
||||
return m_pTiles[ny*m_Width+nx].m_Index;
|
||||
return m_pTiles[Ny*m_Width+Nx].m_Index;
|
||||
}
|
||||
|
||||
int CCollision::GetFIndex(int nx, int ny)
|
||||
int CCollision::GetFIndex(int Nx, int Ny)
|
||||
{
|
||||
if(!m_pFront) return 0;
|
||||
return m_pFront[ny*m_Width+nx].m_Index;
|
||||
return m_pFront[Ny*m_Width+Nx].m_Index;
|
||||
}
|
||||
|
||||
int CCollision::GetFTile(int x, int y)
|
||||
{
|
||||
if(!m_pFront)
|
||||
return 0;
|
||||
int nx = clamp(x/32, 0, m_Width-1);
|
||||
int ny = clamp(y/32, 0, m_Height-1);
|
||||
/*dbg_msg("GetFTile","m_Index %d",m_pFront[ny*m_Width+nx].m_Index);//Remove */
|
||||
if(m_pFront[ny*m_Width+nx].m_Index == COLFLAG_DEATH
|
||||
|| m_pFront[ny*m_Width+nx].m_Index == COLFLAG_NOLASER)
|
||||
return m_pFront[ny*m_Width+nx].m_Index;
|
||||
int Nx = clamp(x/32, 0, m_Width-1);
|
||||
int Ny = clamp(y/32, 0, m_Height-1);
|
||||
/*dbg_msg("GetFTile","m_Index %d",m_pFront[Ny*m_Width+Nx].m_Index);//Remove */
|
||||
if(m_pFront[Ny*m_Width+Nx].m_Index == COLFLAG_DEATH
|
||||
|| m_pFront[Ny*m_Width+Nx].m_Index == COLFLAG_NOLASER)
|
||||
return m_pFront[Ny*m_Width+Nx].m_Index;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
@ -749,7 +749,7 @@ int CCollision::Entity(int x, int y, int Layer)
|
|||
default:
|
||||
str_format(aBuf,sizeof(aBuf), "Unknown");
|
||||
}
|
||||
dbg_msg("CCollision::Entity","Something is VERY wrong with the %s layer please report this at http://DDRace.info, you will need to post the map as well and any steps that u think may have led to this, Please Also Read the News Section every once and a while", aBuf);
|
||||
dbg_msg("CCollision::Entity","Something is VERY wrong with the %s layer please report this at http://DDRace.info, you will need to post the map as well and aNy steps that u think may have led to this, Please Also Read the News Section every once and a while", aBuf);
|
||||
return 0;
|
||||
}
|
||||
switch (Layer)
|
||||
|
@ -772,22 +772,22 @@ int CCollision::Entity(int x, int y, int Layer)
|
|||
|
||||
void CCollision::SetCollisionAt(float x, float y, int flag)
|
||||
{
|
||||
int nx = clamp(round(x)/32, 0, m_Width-1);
|
||||
int ny = clamp(round(y)/32, 0, m_Height-1);
|
||||
int Nx = clamp(round(x)/32, 0, m_Width-1);
|
||||
int Ny = clamp(round(y)/32, 0, m_Height-1);
|
||||
|
||||
m_pTiles[ny * m_Width + nx].m_Index = flag;
|
||||
m_pTiles[Ny * m_Width + Nx].m_Index = flag;
|
||||
}
|
||||
|
||||
void CCollision::SetDCollisionAt(float x, float y, int Type, int Flags, int Number)
|
||||
{
|
||||
if(!m_pDoor)
|
||||
return;
|
||||
int nx = clamp(round(x)/32, 0, m_Width-1);
|
||||
int ny = clamp(round(y)/32, 0, m_Height-1);
|
||||
int Nx = clamp(round(x)/32, 0, m_Width-1);
|
||||
int Ny = clamp(round(y)/32, 0, m_Height-1);
|
||||
|
||||
m_pDoor[ny * m_Width + nx].m_Index = Type;
|
||||
m_pDoor[ny * m_Width + nx].m_Flags = Flags;
|
||||
m_pDoor[ny * m_Width + nx].m_Number = Number;
|
||||
m_pDoor[Ny * m_Width + Nx].m_Index = Type;
|
||||
m_pDoor[Ny * m_Width + Nx].m_Flags = Flags;
|
||||
m_pDoor[Ny * m_Width + Nx].m_Number = Number;
|
||||
}
|
||||
|
||||
int CCollision::GetDTileIndex(int Index)
|
||||
|
@ -852,18 +852,18 @@ int CCollision::IntersectNoLaser(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2
|
|||
{
|
||||
float a = f/d;
|
||||
vec2 Pos = mix(Pos0, Pos1, a);
|
||||
int nx = clamp(round(Pos.x)/32, 0, m_Width-1);
|
||||
int ny = clamp(round(Pos.y)/32, 0, m_Height-1);
|
||||
if(GetIndex(nx, ny) == COLFLAG_SOLID
|
||||
|| GetIndex(nx, ny) == (COLFLAG_SOLID|COLFLAG_NOHOOK)
|
||||
|| GetIndex(nx, ny) == COLFLAG_NOLASER
|
||||
|| GetFIndex(nx, ny) == COLFLAG_NOLASER)
|
||||
int Nx = clamp(round(Pos.x)/32, 0, m_Width-1);
|
||||
int Ny = clamp(round(Pos.y)/32, 0, m_Height-1);
|
||||
if(GetIndex(Nx, Ny) == COLFLAG_SOLID
|
||||
|| GetIndex(Nx, Ny) == (COLFLAG_SOLID|COLFLAG_NOHOOK)
|
||||
|| GetIndex(Nx, Ny) == COLFLAG_NOLASER
|
||||
|| GetFIndex(Nx, Ny) == COLFLAG_NOLASER)
|
||||
{
|
||||
if(pOutCollision)
|
||||
*pOutCollision = Pos;
|
||||
if(pOutBeforeCollision)
|
||||
*pOutBeforeCollision = Last;
|
||||
if (GetFIndex(nx, ny) == COLFLAG_NOLASER) return GetFCollisionAt(Pos.x, Pos.y);
|
||||
if (GetFIndex(Nx, Ny) == COLFLAG_NOLASER) return GetFCollisionAt(Pos.x, Pos.y);
|
||||
else return GetCollisionAt(Pos.x, Pos.y);
|
||||
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
int IntersectNoLaser(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision);
|
||||
int IntersectNoLaserNW(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision);
|
||||
int IntersectAir(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision);
|
||||
void MovePoint(vec2 *pInoutPos, vec2 *pInoutVel, float Elasticity, int *Bpounces);
|
||||
void MovePoint(vec2 *pInoutPos, vec2 *pInoutVel, float Elasticity, int *pBounces);
|
||||
void MoveBox(vec2 *pInoutPos, vec2 *pInoutVel, vec2 Size, float Elasticity);
|
||||
bool TestBox(vec2 Pos, vec2 Size);
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ enum
|
|||
|
||||
CEditorImage::~CEditorImage()
|
||||
{
|
||||
m_pEditor->Graphics()->UnloadTexture(m_TexId);
|
||||
m_pEditor->Graphics()->UnloadTexture(m_TexID);
|
||||
}
|
||||
|
||||
CLayerGroup::CLayerGroup()
|
||||
|
@ -166,9 +166,9 @@ void CEditorImage::AnalyseTileFlags()
|
|||
{
|
||||
unsigned char *pPixelData = (unsigned char *)m_pData;
|
||||
|
||||
int TileId = 0;
|
||||
int TileID = 0;
|
||||
for(int ty = 0; ty < 16; ty++)
|
||||
for(int tx = 0; tx < 16; tx++, TileId++)
|
||||
for(int tx = 0; tx < 16; tx++, TileID++)
|
||||
{
|
||||
bool Opaque = true;
|
||||
for(int x = 0; x < tw; x++)
|
||||
|
@ -183,7 +183,7 @@ void CEditorImage::AnalyseTileFlags()
|
|||
}
|
||||
|
||||
if(Opaque)
|
||||
m_aTileFlags[TileId] |= TILEFLAG_OPAQUE;
|
||||
m_aTileFlags[TileID] |= TILEFLAG_OPAQUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -285,16 +285,16 @@ int CEditor::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned Str
|
|||
return ReturnValue;
|
||||
}
|
||||
|
||||
vec4 CEditor::ButtonColorMul(const void *pId)
|
||||
vec4 CEditor::ButtonColorMul(const void *pID)
|
||||
{
|
||||
if(UI()->ActiveItem() == pId)
|
||||
if(UI()->ActiveItem() == pID)
|
||||
return vec4(1,1,1,0.5f);
|
||||
else if(UI()->HotItem() == pId)
|
||||
else if(UI()->HotItem() == pID)
|
||||
return vec4(1,1,1,1.5f);
|
||||
return vec4(1,1,1,1);
|
||||
}
|
||||
|
||||
float CEditor::UiDoScrollbarV(const void *pId, const CUIRect *pRect, float Current)
|
||||
float CEditor::UiDoScrollbarV(const void *pID, const CUIRect *pRect, float Current)
|
||||
{
|
||||
CUIRect Handle;
|
||||
static float s_OffsetY;
|
||||
|
@ -306,7 +306,7 @@ float CEditor::UiDoScrollbarV(const void *pId, const CUIRect *pRect, float Curre
|
|||
float Ret = Current;
|
||||
int Inside = UI()->MouseInside(&Handle);
|
||||
|
||||
if(UI()->ActiveItem() == pId)
|
||||
if(UI()->ActiveItem() == pID)
|
||||
{
|
||||
if(!UI()->MouseButton(0))
|
||||
UI()->SetActiveItem(0);
|
||||
|
@ -318,17 +318,17 @@ float CEditor::UiDoScrollbarV(const void *pId, const CUIRect *pRect, float Curre
|
|||
if(Ret < 0.0f) Ret = 0.0f;
|
||||
if(Ret > 1.0f) Ret = 1.0f;
|
||||
}
|
||||
else if(UI()->HotItem() == pId)
|
||||
else if(UI()->HotItem() == pID)
|
||||
{
|
||||
if(UI()->MouseButton(0))
|
||||
{
|
||||
UI()->SetActiveItem(pId);
|
||||
UI()->SetActiveItem(pID);
|
||||
s_OffsetY = UI()->MouseY()-Handle.y;
|
||||
}
|
||||
}
|
||||
|
||||
if(Inside)
|
||||
UI()->SetHotItem(pId);
|
||||
UI()->SetHotItem(pID);
|
||||
|
||||
// render
|
||||
CUIRect Rail;
|
||||
|
@ -343,24 +343,24 @@ float CEditor::UiDoScrollbarV(const void *pId, const CUIRect *pRect, float Curre
|
|||
|
||||
Slider = Handle;
|
||||
Slider.Margin(5.0f, &Slider);
|
||||
RenderTools()->DrawUIRect(&Slider, vec4(1,1,1,0.25f)*ButtonColorMul(pId), CUI::CORNER_ALL, 2.5f);
|
||||
RenderTools()->DrawUIRect(&Slider, vec4(1,1,1,0.25f)*ButtonColorMul(pID), CUI::CORNER_ALL, 2.5f);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
||||
vec4 CEditor::GetButtonColor(const void *pId, int Checked)
|
||||
vec4 CEditor::GetButtonColor(const void *pID, int Checked)
|
||||
{
|
||||
if(Checked < 0)
|
||||
return vec4(0,0,0,0.5f);
|
||||
|
||||
if(Checked > 0)
|
||||
{
|
||||
if(UI()->HotItem() == pId)
|
||||
if(UI()->HotItem() == pID)
|
||||
return vec4(1,0,0,0.75f);
|
||||
return vec4(1,0,0,0.5f);
|
||||
}
|
||||
|
||||
if(UI()->HotItem() == pId)
|
||||
if(UI()->HotItem() == pID)
|
||||
return vec4(1,1,1,0.75f);
|
||||
return vec4(1,1,1,0.5f);
|
||||
}
|
||||
|
@ -471,14 +471,14 @@ void CEditor::RenderBackground(CUIRect View, int Texture, float Size, float Brig
|
|||
Graphics()->QuadsEnd();
|
||||
}
|
||||
|
||||
int CEditor::UiDoValueSelector(void *pId, CUIRect *r, const char *pLabel, int Current, int Min, int Max, int Step, float Scale, const char *pToolTip)
|
||||
int CEditor::UiDoValueSelector(void *pID, CUIRect *pRect, const char *pLabel, int Current, int Min, int Max, int Step, float Scale, const char *pToolTip)
|
||||
{
|
||||
// logic
|
||||
static float s_Value;
|
||||
int Ret = 0;
|
||||
int Inside = UI()->MouseInside(r);
|
||||
int Inside = UI()->MouseInside(pRect);
|
||||
|
||||
if(UI()->ActiveItem() == pId)
|
||||
if(UI()->ActiveItem() == pID)
|
||||
{
|
||||
if(!UI()->MouseButton(0))
|
||||
{
|
||||
|
@ -508,27 +508,27 @@ int CEditor::UiDoValueSelector(void *pId, CUIRect *r, const char *pLabel, int Cu
|
|||
if(pToolTip)
|
||||
m_pTooltip = pToolTip;
|
||||
}
|
||||
else if(UI()->HotItem() == pId)
|
||||
else if(UI()->HotItem() == pID)
|
||||
{
|
||||
if(UI()->MouseButton(0))
|
||||
{
|
||||
m_LockMouse = true;
|
||||
s_Value = 0;
|
||||
UI()->SetActiveItem(pId);
|
||||
UI()->SetActiveItem(pID);
|
||||
}
|
||||
if(pToolTip)
|
||||
m_pTooltip = pToolTip;
|
||||
}
|
||||
|
||||
if(Inside)
|
||||
UI()->SetHotItem(pId);
|
||||
UI()->SetHotItem(pID);
|
||||
|
||||
// render
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof(aBuf),"%s %d", pLabel, Current);
|
||||
RenderTools()->DrawUIRect(r, GetButtonColor(pId, 0), CUI::CORNER_ALL, 5.0f);
|
||||
r->y += r->h/2.0f-7.0f;
|
||||
UI()->DoLabel(r, aBuf, 10, 0, -1);
|
||||
RenderTools()->DrawUIRect(pRect, GetButtonColor(pID, 0), CUI::CORNER_ALL, 5.0f);
|
||||
pRect->y += pRect->h/2.0f-7.0f;
|
||||
UI()->DoLabel(pRect, aBuf, 10, 0, -1);
|
||||
|
||||
return Current;
|
||||
}
|
||||
|
@ -830,8 +830,8 @@ void CEditor::DoToolbar(CUIRect ToolBar)
|
|||
|
||||
if(DoButton_Ex(&s_TeleButton, "Teleporter", (pS && pS->m_Tele)?0:-1, &Button, 0, "Teleporter", CUI::CORNER_ALL))
|
||||
{
|
||||
static int s_TelePopupId = 0;
|
||||
UiInvokePopupMenu(&s_TelePopupId, 0, UI()->MouseX(), UI()->MouseY(), 120, 23, PopupTele);
|
||||
static int s_TelePopupID = 0;
|
||||
UiInvokePopupMenu(&s_TelePopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 23, PopupTele);
|
||||
}
|
||||
// do speedup button
|
||||
TB_Bottom.VSplitLeft(5.0f, &Button, &TB_Bottom);
|
||||
|
@ -839,8 +839,8 @@ void CEditor::DoToolbar(CUIRect ToolBar)
|
|||
static int s_SpeedupButton = 0;
|
||||
if(DoButton_Ex(&s_SpeedupButton, "Speedup", (pS && pS->m_Speedup)?0:-1, &Button, 0, "Speedup", CUI::CORNER_ALL))
|
||||
{
|
||||
static int s_SpeedupPopupId = 0;
|
||||
UiInvokePopupMenu(&s_SpeedupPopupId, 0, UI()->MouseX(), UI()->MouseY(), 120, 53, PopupSpeedup);
|
||||
static int s_SpeedupPopupID = 0;
|
||||
UiInvokePopupMenu(&s_SpeedupPopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 53, PopupSpeedup);
|
||||
}
|
||||
// do switch button
|
||||
TB_Bottom.VSplitLeft(5.0f, &Button, &TB_Bottom);
|
||||
|
@ -848,8 +848,8 @@ void CEditor::DoToolbar(CUIRect ToolBar)
|
|||
static int s_SwitchButton = 0;
|
||||
if(DoButton_Ex(&s_SwitchButton, "Switcher", (pS && pS->m_Switch)?0:-1, &Button, 0, "Switcher", CUI::CORNER_ALL))
|
||||
{
|
||||
static int s_SwitchPopupId = 0;
|
||||
UiInvokePopupMenu(&s_SwitchPopupId, 0, UI()->MouseX(), UI()->MouseY(), 120, 36, PopupSwitch);
|
||||
static int s_SwitchPopupID = 0;
|
||||
UiInvokePopupMenu(&s_SwitchPopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 36, PopupSwitch);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -885,7 +885,7 @@ void CEditor::DoQuad(CQuad *q, int Index)
|
|||
};
|
||||
|
||||
// some basic values
|
||||
void *pId = &q->m_aPoints[4]; // use pivot addr as id
|
||||
void *pID = &q->m_aPoints[4]; // use pivot addr as id
|
||||
static CPoint s_RotatePoints[4];
|
||||
static float s_LastWx;
|
||||
static float s_LastWy;
|
||||
|
@ -901,7 +901,7 @@ void CEditor::DoQuad(CQuad *q, int Index)
|
|||
float dx = (CenterX - wx)/m_WorldZoom;
|
||||
float dy = (CenterY - wy)/m_WorldZoom;
|
||||
if(dx*dx+dy*dy < 50)
|
||||
UI()->SetHotItem(pId);
|
||||
UI()->SetHotItem(pID);
|
||||
|
||||
// draw selection background
|
||||
if(m_SelectedQuad == Index)
|
||||
|
@ -911,7 +911,7 @@ void CEditor::DoQuad(CQuad *q, int Index)
|
|||
Graphics()->QuadsDraw(&QuadItem, 1);
|
||||
}
|
||||
|
||||
if(UI()->ActiveItem() == pId)
|
||||
if(UI()->ActiveItem() == pID)
|
||||
{
|
||||
// check if we only should move pivot
|
||||
if(s_Operation == OP_MOVE_PIVOT)
|
||||
|
@ -945,8 +945,8 @@ void CEditor::DoQuad(CQuad *q, int Index)
|
|||
{
|
||||
if(!UI()->MouseButton(1))
|
||||
{
|
||||
static int s_QuadPopupId = 0;
|
||||
UiInvokePopupMenu(&s_QuadPopupId, 0, UI()->MouseX(), UI()->MouseY(), 120, 150, PopupQuad);
|
||||
static int s_QuadPopupID = 0;
|
||||
UiInvokePopupMenu(&s_QuadPopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 150, PopupQuad);
|
||||
m_LockMouse = false;
|
||||
s_Operation = OP_NONE;
|
||||
UI()->SetActiveItem(0);
|
||||
|
@ -964,9 +964,9 @@ void CEditor::DoQuad(CQuad *q, int Index)
|
|||
|
||||
Graphics()->SetColor(1,1,1,1);
|
||||
}
|
||||
else if(UI()->HotItem() == pId)
|
||||
else if(UI()->HotItem() == pID)
|
||||
{
|
||||
ms_pUiGotContext = pId;
|
||||
ms_pUiGotContext = pID;
|
||||
|
||||
Graphics()->SetColor(1,1,1,1);
|
||||
m_pTooltip = Localize("Left mouse button to move. Hold shift to move pivot. Hold ctrl to rotate.");
|
||||
|
@ -988,7 +988,7 @@ void CEditor::DoQuad(CQuad *q, int Index)
|
|||
else
|
||||
s_Operation = OP_MOVE_ALL;
|
||||
|
||||
UI()->SetActiveItem(pId);
|
||||
UI()->SetActiveItem(pID);
|
||||
m_SelectedQuad = Index;
|
||||
s_LastWx = wx;
|
||||
s_LastWy = wy;
|
||||
|
@ -998,7 +998,7 @@ void CEditor::DoQuad(CQuad *q, int Index)
|
|||
{
|
||||
m_SelectedQuad = Index;
|
||||
s_Operation = OP_CONTEXT_MENU;
|
||||
UI()->SetActiveItem(pId);
|
||||
UI()->SetActiveItem(pID);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1008,23 +1008,23 @@ void CEditor::DoQuad(CQuad *q, int Index)
|
|||
Graphics()->QuadsDraw(&QuadItem, 1);
|
||||
}
|
||||
|
||||
void CEditor::DoQuadPoint(CQuad *q, int QuadIndex, int v)
|
||||
void CEditor::DoQuadPoint(CQuad *pQuad, int QuadIndex, int V)
|
||||
{
|
||||
void *pId = &q->m_aPoints[v];
|
||||
void *pID = &pQuad->m_aPoints[V];
|
||||
|
||||
float wx = UI()->MouseWorldX();
|
||||
float wy = UI()->MouseWorldY();
|
||||
|
||||
float px = fx2f(q->m_aPoints[v].x);
|
||||
float py = fx2f(q->m_aPoints[v].y);
|
||||
float px = fx2f(pQuad->m_aPoints[V].x);
|
||||
float py = fx2f(pQuad->m_aPoints[V].y);
|
||||
|
||||
float dx = (px - wx)/m_WorldZoom;
|
||||
float dy = (py - wy)/m_WorldZoom;
|
||||
if(dx*dx+dy*dy < 50)
|
||||
UI()->SetHotItem(pId);
|
||||
UI()->SetHotItem(pID);
|
||||
|
||||
// draw selection background
|
||||
if(m_SelectedQuad == QuadIndex && m_SelectedPoints&(1<<v))
|
||||
if(m_SelectedQuad == QuadIndex && m_SelectedPoints&(1<<V))
|
||||
{
|
||||
Graphics()->SetColor(0,0,0,1);
|
||||
IGraphics::CQuadItem QuadItem(px, py, 7.0f, 7.0f);
|
||||
|
@ -1042,7 +1042,7 @@ void CEditor::DoQuadPoint(CQuad *q, int QuadIndex, int v)
|
|||
static bool s_Moved;
|
||||
static int s_Operation = OP_NONE;
|
||||
|
||||
if(UI()->ActiveItem() == pId)
|
||||
if(UI()->ActiveItem() == pID)
|
||||
{
|
||||
float dx = m_MouseDeltaWx;
|
||||
float dy = m_MouseDeltaWy;
|
||||
|
@ -1059,8 +1059,8 @@ void CEditor::DoQuadPoint(CQuad *q, int QuadIndex, int v)
|
|||
for(int m = 0; m < 4; m++)
|
||||
if(m_SelectedPoints&(1<<m))
|
||||
{
|
||||
q->m_aPoints[m].x += f2fx(dx);
|
||||
q->m_aPoints[m].y += f2fx(dy);
|
||||
pQuad->m_aPoints[m].x += f2fx(dx);
|
||||
pQuad->m_aPoints[m].y += f2fx(dy);
|
||||
}
|
||||
}
|
||||
else if(s_Operation == OP_MOVEUV)
|
||||
|
@ -1071,11 +1071,11 @@ void CEditor::DoQuadPoint(CQuad *q, int QuadIndex, int v)
|
|||
// 0,2;1,3 - line x
|
||||
// 0,1;2,3 - line y
|
||||
|
||||
q->m_aTexcoords[m].x += f2fx(dx*0.001f);
|
||||
q->m_aTexcoords[(m+2)%4].x += f2fx(dx*0.001f);
|
||||
pQuad->m_aTexcoords[m].x += f2fx(dx*0.001f);
|
||||
pQuad->m_aTexcoords[(m+2)%4].x += f2fx(dx*0.001f);
|
||||
|
||||
q->m_aTexcoords[m].y += f2fx(dy*0.001f);
|
||||
q->m_aTexcoords[m^1].y += f2fx(dy*0.001f);
|
||||
pQuad->m_aTexcoords[m].y += f2fx(dy*0.001f);
|
||||
pQuad->m_aTexcoords[m^1].y += f2fx(dy*0.001f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1084,8 +1084,8 @@ void CEditor::DoQuadPoint(CQuad *q, int QuadIndex, int v)
|
|||
{
|
||||
if(!UI()->MouseButton(1))
|
||||
{
|
||||
static int s_PointPopupId = 0;
|
||||
UiInvokePopupMenu(&s_PointPopupId, 0, UI()->MouseX(), UI()->MouseY(), 120, 150, PopupPoint);
|
||||
static int s_PointPopupID = 0;
|
||||
UiInvokePopupMenu(&s_PointPopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 150, PopupPoint);
|
||||
UI()->SetActiveItem(0);
|
||||
}
|
||||
}
|
||||
|
@ -1096,9 +1096,9 @@ void CEditor::DoQuadPoint(CQuad *q, int QuadIndex, int v)
|
|||
if(!s_Moved)
|
||||
{
|
||||
if(Input()->KeyPressed(KEY_LSHIFT) || Input()->KeyPressed(KEY_RSHIFT))
|
||||
m_SelectedPoints ^= 1<<v;
|
||||
m_SelectedPoints ^= 1<<V;
|
||||
else
|
||||
m_SelectedPoints = 1<<v;
|
||||
m_SelectedPoints = 1<<V;
|
||||
}
|
||||
m_LockMouse = false;
|
||||
UI()->SetActiveItem(0);
|
||||
|
@ -1107,16 +1107,16 @@ void CEditor::DoQuadPoint(CQuad *q, int QuadIndex, int v)
|
|||
|
||||
Graphics()->SetColor(1,1,1,1);
|
||||
}
|
||||
else if(UI()->HotItem() == pId)
|
||||
else if(UI()->HotItem() == pID)
|
||||
{
|
||||
ms_pUiGotContext = pId;
|
||||
ms_pUiGotContext = pID;
|
||||
|
||||
Graphics()->SetColor(1,1,1,1);
|
||||
m_pTooltip = Localize("Left mouse button to move. Hold shift to move the texture.");
|
||||
|
||||
if(UI()->MouseButton(0))
|
||||
{
|
||||
UI()->SetActiveItem(pId);
|
||||
UI()->SetActiveItem(pID);
|
||||
s_Moved = false;
|
||||
if(Input()->KeyPressed(KEY_LSHIFT) || Input()->KeyPressed(KEY_RSHIFT))
|
||||
{
|
||||
|
@ -1126,12 +1126,12 @@ void CEditor::DoQuadPoint(CQuad *q, int QuadIndex, int v)
|
|||
else
|
||||
s_Operation = OP_MOVEPOINT;
|
||||
|
||||
if(!(m_SelectedPoints&(1<<v)))
|
||||
if(!(m_SelectedPoints&(1<<V)))
|
||||
{
|
||||
if(Input()->KeyPressed(KEY_LSHIFT) || Input()->KeyPressed(KEY_RSHIFT))
|
||||
m_SelectedPoints |= 1<<v;
|
||||
m_SelectedPoints |= 1<<V;
|
||||
else
|
||||
m_SelectedPoints = 1<<v;
|
||||
m_SelectedPoints = 1<<V;
|
||||
s_Moved = true;
|
||||
}
|
||||
|
||||
|
@ -1141,13 +1141,13 @@ void CEditor::DoQuadPoint(CQuad *q, int QuadIndex, int v)
|
|||
{
|
||||
s_Operation = OP_CONTEXT_MENU;
|
||||
m_SelectedQuad = QuadIndex;
|
||||
UI()->SetActiveItem(pId);
|
||||
if(!(m_SelectedPoints&(1<<v)))
|
||||
UI()->SetActiveItem(pID);
|
||||
if(!(m_SelectedPoints&(1<<V)))
|
||||
{
|
||||
if(Input()->KeyPressed(KEY_LSHIFT) || Input()->KeyPressed(KEY_RSHIFT))
|
||||
m_SelectedPoints |= 1<<v;
|
||||
m_SelectedPoints |= 1<<V;
|
||||
else
|
||||
m_SelectedPoints = 1<<v;
|
||||
m_SelectedPoints = 1<<V;
|
||||
s_Moved = true;
|
||||
}
|
||||
}
|
||||
|
@ -1204,7 +1204,7 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
|
|||
}
|
||||
}
|
||||
|
||||
static void *s_pEditorId = (void *)&s_pEditorId;
|
||||
static void *s_pEditorID = (void *)&s_pEditorID;
|
||||
int Inside = UI()->MouseInside(&View);
|
||||
|
||||
// fetch mouse position
|
||||
|
@ -1244,7 +1244,7 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
|
|||
if(t)
|
||||
{
|
||||
m_TilesetPicker.m_Image = t->m_Image;
|
||||
m_TilesetPicker.m_TexId = t->m_TexId;
|
||||
m_TilesetPicker.m_TexID = t->m_TexID;
|
||||
m_TilesetPicker.Render();
|
||||
}
|
||||
}
|
||||
|
@ -1295,7 +1295,7 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
|
|||
|
||||
if(Inside)
|
||||
{
|
||||
UI()->SetHotItem(s_pEditorId);
|
||||
UI()->SetHotItem(s_pEditorID);
|
||||
|
||||
// do global operations like pan and zoom
|
||||
if(UI()->ActiveItem() == 0 && (UI()->MouseButton(0) || UI()->MouseButton(2)))
|
||||
|
@ -1311,19 +1311,19 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
|
|||
s_Operation = OP_PAN_EDITOR;
|
||||
else
|
||||
s_Operation = OP_PAN_WORLD;
|
||||
UI()->SetActiveItem(s_pEditorId);
|
||||
UI()->SetActiveItem(s_pEditorID);
|
||||
}
|
||||
}
|
||||
|
||||
// brush editing
|
||||
if(UI()->HotItem() == s_pEditorId)
|
||||
if(UI()->HotItem() == s_pEditorID)
|
||||
{
|
||||
if(m_Brush.IsEmpty())
|
||||
m_pTooltip = Localize("Use left mouse button to drag and create a brush.");
|
||||
else
|
||||
m_pTooltip = Localize("Use left mouse button to paint with the brush. Right button clears the brush.");
|
||||
|
||||
if(UI()->ActiveItem() == s_pEditorId)
|
||||
if(UI()->ActiveItem() == s_pEditorID)
|
||||
{
|
||||
CUIRect r;
|
||||
r.x = s_StartWx;
|
||||
|
@ -1401,7 +1401,7 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
|
|||
|
||||
if(UI()->MouseButton(0) && s_Operation == OP_NONE)
|
||||
{
|
||||
UI()->SetActiveItem(s_pEditorId);
|
||||
UI()->SetActiveItem(s_pEditorID);
|
||||
|
||||
if(m_Brush.IsEmpty())
|
||||
s_Operation = OP_BRUSH_GRAB;
|
||||
|
@ -1492,7 +1492,7 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
|
|||
}
|
||||
|
||||
// do panning
|
||||
if(UI()->ActiveItem() == s_pEditorId)
|
||||
if(UI()->ActiveItem() == s_pEditorID)
|
||||
{
|
||||
if(s_Operation == OP_PAN_WORLD)
|
||||
{
|
||||
|
@ -1514,7 +1514,7 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(UI()->ActiveItem() == s_pEditorId)
|
||||
else if(UI()->ActiveItem() == s_pEditorID)
|
||||
{
|
||||
// release mouse
|
||||
if(!UI()->MouseButton(0))
|
||||
|
@ -1637,7 +1637,7 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
|
|||
}
|
||||
|
||||
|
||||
int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIds, int *pNewVal)
|
||||
int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIDs, int *pNewVal)
|
||||
{
|
||||
int Change = -1;
|
||||
|
||||
|
@ -1661,12 +1661,12 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIds, int *
|
|||
RenderTools()->DrawUIRect(&Shifter, vec4(1,1,1,0.5f), 0, 0.0f);
|
||||
UI()->DoLabel(&Shifter, aBuf, 10.0f, 0, -1);
|
||||
|
||||
if(DoButton_ButtonDec(&pIds[i], 0, 0, &Dec, 0, Localize("Decrease")))
|
||||
if(DoButton_ButtonDec(&pIDs[i], 0, 0, &Dec, 0, Localize("Decrease")))
|
||||
{
|
||||
*pNewVal = pProps[i].m_Value-1;
|
||||
Change = i;
|
||||
}
|
||||
if(DoButton_ButtonInc(((char *)&pIds[i])+1, 0, 0, &Inc, 0, Localize("Increase")))
|
||||
if(DoButton_ButtonInc(((char *)&pIDs[i])+1, 0, 0, &Inc, 0, Localize("Increase")))
|
||||
{
|
||||
*pNewVal = pProps[i].m_Value+1;
|
||||
Change = i;
|
||||
|
@ -1676,12 +1676,12 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIds, int *
|
|||
{
|
||||
CUIRect No, Yes;
|
||||
Shifter.VSplitMid(&No, &Yes);
|
||||
if(DoButton_ButtonDec(&pIds[i], Localize("No"), !pProps[i].m_Value, &No, 0, ""))
|
||||
if(DoButton_ButtonDec(&pIDs[i], Localize("No"), !pProps[i].m_Value, &No, 0, ""))
|
||||
{
|
||||
*pNewVal = 0;
|
||||
Change = i;
|
||||
}
|
||||
if(DoButton_ButtonInc(((char *)&pIds[i])+1, Localize("Yes"), pProps[i].m_Value, &Yes, 0, ""))
|
||||
if(DoButton_ButtonInc(((char *)&pIDs[i])+1, Localize("Yes"), pProps[i].m_Value, &Yes, 0, ""))
|
||||
{
|
||||
*pNewVal = 1;
|
||||
Change = i;
|
||||
|
@ -1689,7 +1689,7 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIds, int *
|
|||
}
|
||||
else if(pProps[i].m_Type == PROPTYPE_INT_SCROLL)
|
||||
{
|
||||
int NewValue = UiDoValueSelector(&pIds[i], &Shifter, "", pProps[i].m_Value, pProps[i].m_Min, pProps[i].m_Max, 1, 1.0f, Localize("Use left mouse button to drag and change the value. Hold shift to be more precise."));
|
||||
int NewValue = UiDoValueSelector(&pIDs[i], &Shifter, "", pProps[i].m_Value, pProps[i].m_Min, pProps[i].m_Max, 1, 1.0f, Localize("Use left mouse button to drag and change the value. Hold shift to be more precise."));
|
||||
if(NewValue != pProps[i].m_Value)
|
||||
{
|
||||
*pNewVal = NewValue;
|
||||
|
@ -1705,7 +1705,7 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIds, int *
|
|||
for(int c = 0; c < 4; c++)
|
||||
{
|
||||
int v = (pProps[i].m_Value >> s_aShift[c])&0xff;
|
||||
NewColor |= UiDoValueSelector(((char *)&pIds[i])+c, &Shifter, s_paTexts[c], v, 0, 255, 1, 1.0f, Localize("Use left mouse button to drag and change the color value. Hold shift to be more precise."))<<s_aShift[c];
|
||||
NewColor |= UiDoValueSelector(((char *)&pIDs[i])+c, &Shifter, s_paTexts[c], v, 0, 255, 1, 1.0f, Localize("Use left mouse button to drag and change the color value. Hold shift to be more precise."))<<s_aShift[c];
|
||||
|
||||
if(c != 3)
|
||||
{
|
||||
|
@ -1729,7 +1729,7 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIds, int *
|
|||
else
|
||||
str_format(aBuf, sizeof(aBuf),"%s", m_Map.m_lImages[pProps[i].m_Value]->m_aName);
|
||||
|
||||
if(DoButton_Editor(&pIds[i], aBuf, 0, &Shifter, 0, 0))
|
||||
if(DoButton_Editor(&pIDs[i], aBuf, 0, &Shifter, 0, 0))
|
||||
PopupSelectImageInvoke(pProps[i].m_Value, UI()->MouseX(), UI()->MouseY());
|
||||
|
||||
int r = PopupSelectImageResult();
|
||||
|
@ -1753,22 +1753,22 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIds, int *
|
|||
Shifter.VSplitRight(10.0f, &Shifter, &Down);
|
||||
RenderTools()->DrawUIRect(&Shifter, vec4(1,1,1,0.5f), 0, 0.0f);
|
||||
UI()->DoLabel(&Shifter, "Y", 10.0f, 0, -1);
|
||||
if(DoButton_ButtonDec(&pIds[i], "-", 0, &Left, 0, Localize("Left")))
|
||||
if(DoButton_ButtonDec(&pIDs[i], "-", 0, &Left, 0, Localize("Left")))
|
||||
{
|
||||
*pNewVal = 1;
|
||||
Change = i;
|
||||
}
|
||||
if(DoButton_ButtonInc(((char *)&pIds[i])+3, "+", 0, &Right, 0, Localize("Right")))
|
||||
if(DoButton_ButtonInc(((char *)&pIDs[i])+3, "+", 0, &Right, 0, Localize("Right")))
|
||||
{
|
||||
*pNewVal = 2;
|
||||
Change = i;
|
||||
}
|
||||
if(DoButton_ButtonDec(((char *)&pIds[i])+1, "-", 0, &Up, 0, Localize("Up")))
|
||||
if(DoButton_ButtonDec(((char *)&pIDs[i])+1, "-", 0, &Up, 0, Localize("Up")))
|
||||
{
|
||||
*pNewVal = 4;
|
||||
Change = i;
|
||||
}
|
||||
if(DoButton_ButtonInc(((char *)&pIds[i])+2, "+", 0, &Down, 0, Localize("Down")))
|
||||
if(DoButton_ButtonInc(((char *)&pIDs[i])+2, "+", 0, &Down, 0, Localize("Down")))
|
||||
{
|
||||
*pNewVal = 8;
|
||||
Change = i;
|
||||
|
@ -1856,9 +1856,9 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
|
|||
m_SelectedGroup = g;
|
||||
m_SelectedLayer = 0;
|
||||
|
||||
static int s_GroupPopupId = 0;
|
||||
static int s_GroupPopupID = 0;
|
||||
if(Result == 2)
|
||||
UiInvokePopupMenu(&s_GroupPopupId, 0, UI()->MouseX(), UI()->MouseY(), 120, 200, PopupGroup);
|
||||
UiInvokePopupMenu(&s_GroupPopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 200, PopupGroup);
|
||||
}
|
||||
LayersBox.HSplitTop(2.0f, &Slot, &LayersBox);
|
||||
}
|
||||
|
@ -1893,9 +1893,9 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
|
|||
{
|
||||
m_SelectedLayer = i;
|
||||
m_SelectedGroup = g;
|
||||
static int s_LayerPopupId = 0;
|
||||
static int s_LayerPopupID = 0;
|
||||
if(Result == 2)
|
||||
UiInvokePopupMenu(&s_LayerPopupId, 0, UI()->MouseX(), UI()->MouseY(), 120, 220, PopupLayer);
|
||||
UiInvokePopupMenu(&s_LayerPopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 220, PopupLayer);
|
||||
}
|
||||
|
||||
LayerCur += 14.0f;
|
||||
|
@ -1929,11 +1929,11 @@ void CEditor::ReplaceImage(const char *pFileName, int StorageType, void *pUser)
|
|||
|
||||
CEditorImage *pImg = pEditor->m_Map.m_lImages[pEditor->m_SelectedImage];
|
||||
int External = pImg->m_External;
|
||||
pEditor->Graphics()->UnloadTexture(pImg->m_TexId);
|
||||
pEditor->Graphics()->UnloadTexture(pImg->m_TexID);
|
||||
*pImg = ImgInfo;
|
||||
pImg->m_External = External;
|
||||
pEditor->ExtractName(pFileName, pImg->m_aName, sizeof(pImg->m_aName));
|
||||
pImg->m_TexId = pEditor->Graphics()->LoadTextureRaw(ImgInfo.m_Width, ImgInfo.m_Height, ImgInfo.m_Format, ImgInfo.m_pData, CImageInfo::FORMAT_AUTO, 0);
|
||||
pImg->m_TexID = pEditor->Graphics()->LoadTextureRaw(ImgInfo.m_Width, ImgInfo.m_Height, ImgInfo.m_Format, ImgInfo.m_pData, CImageInfo::FORMAT_AUTO, 0);
|
||||
pEditor->SortImages();
|
||||
for(int i = 0; i < pEditor->m_Map.m_lImages.size(); ++i)
|
||||
{
|
||||
|
@ -1961,7 +1961,7 @@ void CEditor::AddImage(const char *pFileName, int StorageType, void *pUser)
|
|||
|
||||
CEditorImage *pImg = new CEditorImage(pEditor);
|
||||
*pImg = ImgInfo;
|
||||
pImg->m_TexId = pEditor->Graphics()->LoadTextureRaw(ImgInfo.m_Width, ImgInfo.m_Height, ImgInfo.m_Format, ImgInfo.m_pData, CImageInfo::FORMAT_AUTO, 0);
|
||||
pImg->m_TexID = pEditor->Graphics()->LoadTextureRaw(ImgInfo.m_Width, ImgInfo.m_Height, ImgInfo.m_Format, ImgInfo.m_pData, CImageInfo::FORMAT_AUTO, 0);
|
||||
pImg->m_External = 1; // external by default
|
||||
str_copy(pImg->m_aName, aBuf, sizeof(pImg->m_aName));
|
||||
pEditor->m_Map.m_lImages.add(pImg);
|
||||
|
@ -2149,9 +2149,9 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
|
|||
{
|
||||
m_SelectedImage = i;
|
||||
|
||||
static int s_PopupImageId = 0;
|
||||
static int s_PopupImageID = 0;
|
||||
if(Result == 2)
|
||||
UiInvokePopupMenu(&s_PopupImageId, 0, UI()->MouseX(), UI()->MouseY(), 120, 80, PopupImage);
|
||||
UiInvokePopupMenu(&s_PopupImageID, 0, UI()->MouseX(), UI()->MouseY(), 120, 80, PopupImage);
|
||||
}
|
||||
|
||||
ToolBox.HSplitTop(2.0f, 0, &ToolBox);
|
||||
|
@ -2165,7 +2165,7 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
|
|||
r.w = r.h;
|
||||
else
|
||||
r.h = r.w;
|
||||
Graphics()->TextureSet(m_Map.m_lImages[i]->m_TexId);
|
||||
Graphics()->TextureSet(m_Map.m_lImages[i]->m_TexID);
|
||||
Graphics()->BlendNormal();
|
||||
Graphics()->QuadsBegin();
|
||||
IGraphics::CQuadItem QuadItem(r.x, r.y, r.w, r.h);
|
||||
|
@ -2275,9 +2275,9 @@ void CEditor::RenderFileDialog()
|
|||
// filebox
|
||||
if(m_FileDialogStorageType == IStorage::TYPE_SAVE)
|
||||
{
|
||||
static int s_FileBoxId = 0;
|
||||
static int s_FileBoxID = 0;
|
||||
UI()->DoLabel(&FileBoxLabel, Localize("Filename:"), 10.0f, -1, -1);
|
||||
if(DoEditBox(&s_FileBoxId, &FileBox, m_aFileDialogFileName, sizeof(m_aFileDialogFileName), 10.0f))
|
||||
if(DoEditBox(&s_FileBoxID, &FileBox, m_aFileDialogFileName, sizeof(m_aFileDialogFileName), 10.0f))
|
||||
{
|
||||
// remove '/' and '\'
|
||||
for(int i = 0; m_aFileDialogFileName[i]; ++i)
|
||||
|
@ -2646,7 +2646,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
|||
if(pEnvelope)
|
||||
{
|
||||
static array<int> Selection;
|
||||
static int sEnvelopeEditorId = 0;
|
||||
static int sEnvelopeEditorID = 0;
|
||||
static int s_ActiveChannels = 0xf;
|
||||
|
||||
if(pEnvelope)
|
||||
|
@ -2699,9 +2699,9 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
|||
float ValueScale = (Top-Bottom)/View.h;
|
||||
|
||||
if(UI()->MouseInside(&View))
|
||||
UI()->SetHotItem(&sEnvelopeEditorId);
|
||||
UI()->SetHotItem(&sEnvelopeEditorID);
|
||||
|
||||
if(UI()->HotItem() == &sEnvelopeEditorId)
|
||||
if(UI()->HotItem() == &sEnvelopeEditorID)
|
||||
{
|
||||
// do stuff
|
||||
if(pEnvelope)
|
||||
|
@ -2774,12 +2774,12 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
|||
v.h = CurveBar.h;
|
||||
v.w = CurveBar.h;
|
||||
v.x -= v.w/2;
|
||||
void *pId = &pEnvelope->m_lPoints[i].m_Curvetype;
|
||||
void *pID = &pEnvelope->m_lPoints[i].m_Curvetype;
|
||||
const char *paTypeName[] = {
|
||||
"N", "L", "S", "F", "M"
|
||||
};
|
||||
|
||||
if(DoButton_Editor(pId, paTypeName[pEnvelope->m_lPoints[i].m_Curvetype], 0, &v, 0, Localize("Switch curve type")))
|
||||
if(DoButton_Editor(pID, paTypeName[pEnvelope->m_lPoints[i].m_Curvetype], 0, &v, 0, Localize("Switch curve type")))
|
||||
pEnvelope->m_lPoints[i].m_Curvetype = (pEnvelope->m_lPoints[i].m_Curvetype+1)%NUM_CURVETYPES;
|
||||
}
|
||||
}
|
||||
|
@ -2847,14 +2847,14 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
|||
Final.w = 4.0f;
|
||||
Final.h = 4.0f;
|
||||
|
||||
void *pId = &pEnvelope->m_lPoints[i].m_aValues[c];
|
||||
void *pID = &pEnvelope->m_lPoints[i].m_aValues[c];
|
||||
|
||||
if(UI()->MouseInside(&Final))
|
||||
UI()->SetHotItem(pId);
|
||||
UI()->SetHotItem(pID);
|
||||
|
||||
float ColorMod = 1.0f;
|
||||
|
||||
if(UI()->ActiveItem() == pId)
|
||||
if(UI()->ActiveItem() == pID)
|
||||
{
|
||||
if(!UI()->MouseButton(0))
|
||||
{
|
||||
|
@ -2887,13 +2887,13 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
|||
ColorMod = 100.0f;
|
||||
Graphics()->SetColor(1,1,1,1);
|
||||
}
|
||||
else if(UI()->HotItem() == pId)
|
||||
else if(UI()->HotItem() == pID)
|
||||
{
|
||||
if(UI()->MouseButton(0))
|
||||
{
|
||||
Selection.clear();
|
||||
Selection.add(i);
|
||||
UI()->SetActiveItem(pId);
|
||||
UI()->SetActiveItem(pID);
|
||||
}
|
||||
|
||||
// remove point
|
||||
|
@ -2905,7 +2905,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
|||
m_pTooltip = Localize("Left mouse to drag. Hold ctrl to be more precise. Hold shift to alter time point aswell. Right click to delete.");
|
||||
}
|
||||
|
||||
if(UI()->ActiveItem() == pId || UI()->HotItem() == pId)
|
||||
if(UI()->ActiveItem() == pID || UI()->HotItem() == pID)
|
||||
{
|
||||
CurrentTime = pEnvelope->m_lPoints[i].m_Time;
|
||||
CurrentValue = pEnvelope->m_lPoints[i].m_aValues[c];
|
||||
|
@ -3211,35 +3211,35 @@ void CEditorMap::MakeGameLayer(CLayer *pLayer)
|
|||
{
|
||||
m_pGameLayer = (CLayerGame *)pLayer;
|
||||
m_pGameLayer->m_pEditor = m_pEditor;
|
||||
m_pGameLayer->m_TexId = m_pEditor->ms_EntitiesTexture;
|
||||
m_pGameLayer->m_TexID = m_pEditor->ms_EntitiesTexture;
|
||||
}
|
||||
|
||||
void CEditorMap::MakeTeleLayer(CLayer *pLayer)
|
||||
{
|
||||
m_pTeleLayer = (CLayerTele *)pLayer;
|
||||
m_pTeleLayer->m_pEditor = m_pEditor;
|
||||
m_pTeleLayer->m_TexId = m_pEditor->ms_TeleTexture;
|
||||
m_pTeleLayer->m_TexID = m_pEditor->ms_TeleTexture;
|
||||
}
|
||||
|
||||
void CEditorMap::MakeSpeedupLayer(CLayer *pLayer)
|
||||
{
|
||||
m_pSpeedupLayer = (CLayerSpeedup *)pLayer;
|
||||
m_pSpeedupLayer->m_pEditor = m_pEditor;
|
||||
m_pSpeedupLayer->m_TexId = m_pEditor->ms_SpeedupTexture;
|
||||
m_pSpeedupLayer->m_TexID = m_pEditor->ms_SpeedupTexture;
|
||||
}
|
||||
|
||||
void CEditorMap::MakeFrontLayer(CLayer *pLayer)
|
||||
{
|
||||
m_pFrontLayer = (CLayerFront *)pLayer;
|
||||
m_pFrontLayer->m_pEditor = m_pEditor;
|
||||
m_pFrontLayer->m_TexId = m_pEditor->ms_FrontTexture;
|
||||
m_pFrontLayer->m_TexID = m_pEditor->ms_FrontTexture;
|
||||
}
|
||||
|
||||
void CEditorMap::MakeSwitchLayer(CLayer *pLayer)
|
||||
{
|
||||
m_pSwitchLayer = (CLayerSwitch *)pLayer;
|
||||
m_pSwitchLayer->m_pEditor = m_pEditor;
|
||||
m_pSwitchLayer->m_TexId = m_pEditor->ms_SwitchTexture;
|
||||
m_pSwitchLayer->m_TexID = m_pEditor->ms_SwitchTexture;
|
||||
}
|
||||
|
||||
void CEditorMap::MakeGameGroup(CLayerGroup *pGroup)
|
||||
|
|
|
@ -235,7 +235,7 @@ public:
|
|||
CEditorImage(CEditor *pEditor)
|
||||
{
|
||||
m_pEditor = pEditor;
|
||||
m_TexId = -1;
|
||||
m_TexID = -1;
|
||||
m_aName[0] = 0;
|
||||
m_External = 0;
|
||||
m_Width = 0;
|
||||
|
@ -248,7 +248,7 @@ public:
|
|||
|
||||
void AnalyseTileFlags();
|
||||
|
||||
int m_TexId;
|
||||
int m_TexID;
|
||||
int m_External;
|
||||
char m_aName[128];
|
||||
unsigned char m_aTileFlags[256];
|
||||
|
@ -397,7 +397,7 @@ public:
|
|||
|
||||
void GetSize(float *w, float *h) { *w = m_Width*32.0f; *h = m_Height*32.0f; }
|
||||
|
||||
int m_TexId;
|
||||
int m_TexID;
|
||||
int m_Game;
|
||||
int m_Tele;
|
||||
int m_Speedup;
|
||||
|
@ -618,7 +618,7 @@ public:
|
|||
CLayer *GetSelectedLayer(int Index);
|
||||
CLayerGroup *GetSelectedGroup();
|
||||
|
||||
int DoProperties(CUIRect *pToolbox, CProperty *pProps, int *pIds, int *pNewVal);
|
||||
int DoProperties(CUIRect *pToolbox, CProperty *pProps, int *pIDs, int *pNewVal);
|
||||
|
||||
int m_Mode;
|
||||
int m_Dialog;
|
||||
|
@ -730,16 +730,17 @@ public:
|
|||
|
||||
void RenderBackground(CUIRect View, int Texture, float Size, float Brightness);
|
||||
|
||||
void UiInvokePopupMenu(void *pId, int Flags, float x, float y, float w, float h, int (*pfnFunc)(CEditor *pEditor, CUIRect Rect), void *pExtra=0);
|
||||
void UiInvokePopupMenu(void *pID, int Flags, float X, float Y, float W, float H, int (*pfnFunc)(CEditor *pEditor, CUIRect Rect), void *pExtra=0);
|
||||
void UiDoPopupMenu();
|
||||
|
||||
int UiDoValueSelector(void *pId, CUIRect *r, const char *pLabel, int Current, int Min, int Max, int Step, float Scale, const char *pToolTip);
|
||||
int UiDoValueSelector(void *pID, CUIRect *pRect, const char *pLabel, int Current, int Min, int Max, int Step, float Scale, const char *pToolTip);
|
||||
|
||||
static int PopupGroup(CEditor *pEditor, CUIRect View);
|
||||
static int PopupLayer(CEditor *pEditor, CUIRect View);
|
||||
static int PopupQuad(CEditor *pEditor, CUIRect View);
|
||||
static int PopupPoint(CEditor *pEditor, CUIRect View);
|
||||
static int PopupSelectImage(CEditor *pEditor, CUIRect View);
|
||||
static int PopupSelectGametileOp(CEditor *pEditor, CUIRect View);
|
||||
static int PopupImage(CEditor *pEditor, CUIRect View);
|
||||
static int PopupMenuFile(CEditor *pEditor, CUIRect View);
|
||||
static int PopupTele(CEditor *pEditor, CUIRect View);
|
||||
|
@ -749,15 +750,18 @@ public:
|
|||
|
||||
void PopupSelectImageInvoke(int Current, float x, float y);
|
||||
int PopupSelectImageResult();
|
||||
|
||||
void PopupSelectGametileOpInvoke(float x, float y);
|
||||
int PopupSelectGameTileOpResult();
|
||||
|
||||
vec4 ButtonColorMul(const void *pId);
|
||||
vec4 ButtonColorMul(const void *pID);
|
||||
|
||||
void DoQuadPoint(CQuad *pQuad, int QuadIndex, int v);
|
||||
void DoMapEditor(CUIRect View, CUIRect Toolbar);
|
||||
void DoToolbar(CUIRect Toolbar);
|
||||
void DoQuad(CQuad *pQuad, int Index);
|
||||
float UiDoScrollbarV(const void *id, const CUIRect *pRect, float Current);
|
||||
vec4 GetButtonColor(const void *id, int Checked);
|
||||
float UiDoScrollbarV(const void *pID, const CUIRect *pRect, float Current);
|
||||
vec4 GetButtonColor(const void *pID, int Checked);
|
||||
|
||||
static void ReplaceImage(const char *pFilename, int StorageType, void *pUser);
|
||||
static void AddImage(const char *pFilename, int StorageType, void *pUser);
|
||||
|
|
|
@ -472,7 +472,7 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag
|
|||
if(m_pEditor->Graphics()->LoadPNG(&ImgInfo, aBuf, IStorage::TYPE_ALL))
|
||||
{
|
||||
*pImg = ImgInfo;
|
||||
pImg->m_TexId = m_pEditor->Graphics()->LoadTextureRaw(ImgInfo.m_Width, ImgInfo.m_Height, ImgInfo.m_Format, ImgInfo.m_pData, CImageInfo::FORMAT_AUTO, 0);
|
||||
pImg->m_TexID = m_pEditor->Graphics()->LoadTextureRaw(ImgInfo.m_Width, ImgInfo.m_Height, ImgInfo.m_Format, ImgInfo.m_pData, CImageInfo::FORMAT_AUTO, 0);
|
||||
pImg->m_External = 1;
|
||||
}
|
||||
}
|
||||
|
@ -486,7 +486,7 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag
|
|||
void *pData = DataFile.GetData(pItem->m_ImageData);
|
||||
pImg->m_pData = mem_alloc(pImg->m_Width*pImg->m_Height*4, 1);
|
||||
mem_copy(pImg->m_pData, pData, pImg->m_Width*pImg->m_Height*4);
|
||||
pImg->m_TexId = m_pEditor->Graphics()->LoadTextureRaw(pImg->m_Width, pImg->m_Height, pImg->m_Format, pImg->m_pData, CImageInfo::FORMAT_AUTO, 0);
|
||||
pImg->m_TexID = m_pEditor->Graphics()->LoadTextureRaw(pImg->m_Width, pImg->m_Height, pImg->m_Format, pImg->m_pData, CImageInfo::FORMAT_AUTO, 0);
|
||||
}
|
||||
|
||||
// copy image name
|
||||
|
|
|
@ -43,7 +43,7 @@ void CLayerQuads::Render()
|
|||
{
|
||||
Graphics()->TextureSet(-1);
|
||||
if(m_Image >= 0 && m_Image < m_pEditor->m_Map.m_lImages.size())
|
||||
Graphics()->TextureSet(m_pEditor->m_Map.m_lImages[m_Image]->m_TexId);
|
||||
Graphics()->TextureSet(m_pEditor->m_Map.m_lImages[m_Image]->m_TexID);
|
||||
|
||||
m_pEditor->RenderTools()->RenderQuads(m_lQuads.base_ptr(), m_lQuads.size(), LAYERRENDERFLAG_OPAQUE|LAYERRENDERFLAG_TRANSPARENT, EnvelopeEval, m_pEditor);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ CLayerTiles::CLayerTiles(int w, int h)
|
|||
m_Width = w;
|
||||
m_Height = h;
|
||||
m_Image = -1;
|
||||
m_TexId = -1;
|
||||
m_TexID = -1;
|
||||
m_Game = 0;
|
||||
m_Color.r = 255;
|
||||
m_Color.g = 255;
|
||||
|
@ -64,8 +64,8 @@ void CLayerTiles::MakePalette()
|
|||
void CLayerTiles::Render()
|
||||
{
|
||||
if(m_Image >= 0 && m_Image < m_pEditor->m_Map.m_lImages.size())
|
||||
m_TexId = m_pEditor->m_Map.m_lImages[m_Image]->m_TexId;
|
||||
Graphics()->TextureSet(m_TexId);
|
||||
m_TexID = m_pEditor->m_Map.m_lImages[m_Image]->m_TexID;
|
||||
Graphics()->TextureSet(m_TexID);
|
||||
vec4 Color = vec4(m_Color.r/255.0f, m_Color.g/255.0f, m_Color.b/255.0f, m_Color.a/255.0f);
|
||||
m_pEditor->RenderTools()->RenderTilemap(m_pTiles, m_Width, m_Height, 32.0f, Color, LAYERRENDERFLAG_OPAQUE|LAYERRENDERFLAG_TRANSPARENT);
|
||||
if(m_Tele)
|
||||
|
@ -151,7 +151,7 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)
|
|||
{
|
||||
CLayerTele *pGrabbed = new CLayerTele(r.w, r.h);
|
||||
pGrabbed->m_pEditor = m_pEditor;
|
||||
pGrabbed->m_TexId = m_TexId;
|
||||
pGrabbed->m_TexID = m_TexID;
|
||||
pGrabbed->m_Image = m_Image;
|
||||
pGrabbed->m_Game = m_Game;
|
||||
|
||||
|
@ -178,7 +178,7 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)
|
|||
{
|
||||
CLayerSpeedup *pGrabbed = new CLayerSpeedup(r.w, r.h);
|
||||
pGrabbed->m_pEditor = m_pEditor;
|
||||
pGrabbed->m_TexId = m_TexId;
|
||||
pGrabbed->m_TexID = m_TexID;
|
||||
pGrabbed->m_Image = m_Image;
|
||||
pGrabbed->m_Game = m_Game;
|
||||
|
||||
|
@ -211,7 +211,7 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)
|
|||
{
|
||||
CLayerSwitch *pGrabbed = new CLayerSwitch(r.w, r.h);
|
||||
pGrabbed->m_pEditor = m_pEditor;
|
||||
pGrabbed->m_TexId = m_TexId;
|
||||
pGrabbed->m_TexID = m_TexID;
|
||||
pGrabbed->m_Image = m_Image;
|
||||
pGrabbed->m_Game = m_Game;
|
||||
|
||||
|
@ -242,7 +242,7 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)
|
|||
{
|
||||
CLayerTiles *pGrabbed = new CLayerTiles(r.w, r.h);
|
||||
pGrabbed->m_pEditor = m_pEditor;
|
||||
pGrabbed->m_TexId = m_TexId;
|
||||
pGrabbed->m_TexID = m_TexID;
|
||||
pGrabbed->m_Image = m_Image;
|
||||
pGrabbed->m_Game = m_Game;
|
||||
|
||||
|
@ -462,41 +462,37 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox)
|
|||
if(InGameGroup)
|
||||
{
|
||||
static int s_ColclButton = 0;
|
||||
if(m_pEditor->DoButton_Editor(&s_ColclButton, Localize("Clear collision"), 0, &Button, 0, Localize("Removes collision from this layer")))
|
||||
if(m_pEditor->DoButton_Editor(&s_ColclButton, Localize("Game tiles"), 0, &Button, 0, Localize("Constructs game tiles from this layer")))
|
||||
m_pEditor->PopupSelectGametileOpInvoke(m_pEditor->UI()->MouseX(), m_pEditor->UI()->MouseY());
|
||||
|
||||
int Result = m_pEditor->PopupSelectGameTileOpResult();
|
||||
switch(Result)
|
||||
{
|
||||
CLayerTiles *gl = m_pEditor->m_Map.m_pGameLayer;
|
||||
int w = min(gl->m_Width, m_Width);
|
||||
int h = min(gl->m_Height, m_Height);
|
||||
for(int y = 0; y < h; y++)
|
||||
{
|
||||
for(int x = 0; x < w; x++)
|
||||
{
|
||||
if(gl->m_pTiles[y*gl->m_Width+x].m_Index <= TILE_SOLID)
|
||||
{
|
||||
if(m_pTiles[y*m_Width+x].m_Index)
|
||||
gl->m_pTiles[y*gl->m_Width+x].m_Index = TILE_AIR;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
case 4:
|
||||
Result = TILE_FREEZE;
|
||||
break;
|
||||
case 5:
|
||||
Result = TILE_UNFREEZE;
|
||||
break;
|
||||
case 6:
|
||||
Result = TILE_DFREEZE;
|
||||
break;
|
||||
case 7:
|
||||
Result = TILE_DUNFREEZE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
static int s_ColButton = 0;
|
||||
pToolBox->HSplitBottom(5.0f, pToolBox, &Button);
|
||||
pToolBox->HSplitBottom(12.0f, pToolBox, &Button);
|
||||
if(m_pEditor->DoButton_Editor(&s_ColButton, Localize("Make collision"), 0, &Button, 0, Localize("Constructs collision from this layer")))
|
||||
if(Result > -1)
|
||||
{
|
||||
CLayerTiles *gl = m_pEditor->m_Map.m_pGameLayer;
|
||||
int w = min(gl->m_Width, m_Width);
|
||||
int h = min(gl->m_Height, m_Height);
|
||||
for(int y = 0; y < h; y++)
|
||||
{
|
||||
for(int x = 0; x < w; x++)
|
||||
{
|
||||
if(gl->m_pTiles[y*gl->m_Width+x].m_Index <= TILE_SOLID)
|
||||
gl->m_pTiles[y*gl->m_Width+x].m_Index = m_pTiles[y*m_Width+x].m_Index?TILE_SOLID:TILE_AIR;
|
||||
}
|
||||
}
|
||||
if((gl->m_pTiles[y*gl->m_Width+x].m_Index >= TILE_AIR && gl->m_pTiles[y*gl->m_Width+x].m_Index <= TILE_NOHOOK) || (gl->m_pTiles[y*gl->m_Width+x].m_Index >= TILE_FREEZE && gl->m_pTiles[y*gl->m_Width+x].m_Index <= TILE_DUNFREEZE && gl->m_pTiles[y*gl->m_Width+x].m_Index != TILE_TELEINEVIL))
|
||||
gl->m_pTiles[y*gl->m_Width+x].m_Index = m_pTiles[y*m_Width+x].m_Index?TILE_AIR+Result:TILE_AIR;
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -546,7 +542,7 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox)
|
|||
{
|
||||
if (NewVal == -1)
|
||||
{
|
||||
m_TexId = -1;
|
||||
m_TexID = -1;
|
||||
m_Image = -1;
|
||||
}
|
||||
else
|
||||
|
@ -722,21 +718,21 @@ void CLayerTele::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect)
|
|||
|
||||
if(Empty)
|
||||
{
|
||||
m_pTiles[fy*m_Width+fx].m_Index = 0;
|
||||
m_pTiles[fy*m_Width+fx].m_Index = 0;
|
||||
m_pTeleTile[fy*m_Width+fx].m_Type = 0;
|
||||
m_pTeleTile[fy*m_Width+fx].m_Number = 0;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
m_pTiles[fy*m_Width+fx] = pLt->m_pTiles[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)];
|
||||
m_pTeleTile[fy*m_Width+fx].m_Type = m_pTiles[fy*m_Width+fx].m_Index;
|
||||
if(m_pTiles[fy*m_Width+fx].m_Index > 0)
|
||||
{
|
||||
m_pTiles[fy*m_Width+fx] = pLt->m_pTiles[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)];
|
||||
m_pTeleTile[fy*m_Width+fx].m_Type = m_pTiles[fy*m_Width+fx].m_Index;
|
||||
if(m_pTiles[fy*m_Width+fx].m_Index > 0)
|
||||
{
|
||||
if((!pLt->m_pTeleTile[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)].m_Number && m_pEditor->m_TeleNumber) || m_pEditor->m_TeleNumber != pLt->m_TeleNum)
|
||||
m_pTeleTile[fy*m_Width+fx].m_Number = m_pEditor->m_TeleNumber;
|
||||
else
|
||||
m_pTeleTile[fy*m_Width+fx].m_Number = pLt->m_pTeleTile[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)].m_Number;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -903,14 +899,14 @@ void CLayerSpeedup::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect)
|
|||
|
||||
if(Empty)
|
||||
{
|
||||
m_pTiles[fy*m_Width+fx].m_Index = 0;
|
||||
m_pTiles[fy*m_Width+fx].m_Index = 0;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Force = 0;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Angle = 0;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
m_pTiles[fy*m_Width+fx] = pLt->m_pTiles[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)];
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Type = m_pTiles[fy*m_Width+fx].m_Index;
|
||||
m_pTiles[fy*m_Width+fx] = pLt->m_pTiles[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)];
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Type = m_pTiles[fy*m_Width+fx].m_Index;
|
||||
if(m_pTiles[fy*m_Width+fx].m_Index > 0)
|
||||
{
|
||||
if((!pLt->m_pSpeedupTile[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)].m_Force && m_pEditor->m_SpeedupForce) || m_pEditor->m_SpeedupForce != pLt->m_SpeedupForce)
|
||||
|
@ -1181,16 +1177,16 @@ void CLayerSwitch::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect)
|
|||
|
||||
if(Empty)
|
||||
{
|
||||
m_pTiles[fy*m_Width+fx].m_Index = 0;
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Type = 0;
|
||||
m_pTiles[fy*m_Width+fx].m_Index = 0;
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Type = 0;
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Number = 0;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
m_pTiles[fy*m_Width+fx] = pLt->m_pTiles[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)];
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Type = m_pTiles[fy*m_Width+fx].m_Index;
|
||||
if(m_pEditor->m_SwitchNum && m_pTiles[fy*m_Width+fx].m_Index > 0)
|
||||
{
|
||||
m_pTiles[fy*m_Width+fx] = pLt->m_pTiles[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)];
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Type = m_pTiles[fy*m_Width+fx].m_Index;
|
||||
if(m_pEditor->m_SwitchNum && m_pTiles[fy*m_Width+fx].m_Index > 0)
|
||||
{
|
||||
if((!pLt->m_pSwitchTile[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)].m_Number) || m_pEditor->m_SwitchNum != pLt->m_SwitchNumber)
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Number = m_pEditor->m_SwitchNum;
|
||||
else
|
||||
|
@ -1200,7 +1196,7 @@ void CLayerSwitch::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect)
|
|||
else
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Delay = pLt->m_pSwitchTile[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)].m_Delay;
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Flags = pLt->m_pSwitchTile[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)].m_Flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,19 +20,19 @@ static struct
|
|||
|
||||
static int g_UiNumPopups = 0;
|
||||
|
||||
void CEditor::UiInvokePopupMenu(void *Id, int Flags, float x, float y, float w, float h, int (*pfnFunc)(CEditor *pEditor, CUIRect Rect), void *pExtra)
|
||||
void CEditor::UiInvokePopupMenu(void *pID, int Flags, float X, float Y, float W, float H, int (*pfnFunc)(CEditor *pEditor, CUIRect Rect), void *pExtra)
|
||||
{
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "editor", "invoked");
|
||||
if(x + w > UI()->Screen()->w)
|
||||
x -= w;
|
||||
if(y + h > UI()->Screen()->h)
|
||||
y -= h;
|
||||
s_UiPopups[g_UiNumPopups].m_pId = Id;
|
||||
if(X + W > UI()->Screen()->w)
|
||||
X -= W;
|
||||
if(Y + H > UI()->Screen()->h)
|
||||
Y -= H;
|
||||
s_UiPopups[g_UiNumPopups].m_pId = pID;
|
||||
s_UiPopups[g_UiNumPopups].m_IsMenu = Flags;
|
||||
s_UiPopups[g_UiNumPopups].m_Rect.x = x;
|
||||
s_UiPopups[g_UiNumPopups].m_Rect.y = y;
|
||||
s_UiPopups[g_UiNumPopups].m_Rect.w = w;
|
||||
s_UiPopups[g_UiNumPopups].m_Rect.h = h;
|
||||
s_UiPopups[g_UiNumPopups].m_Rect.x = X;
|
||||
s_UiPopups[g_UiNumPopups].m_Rect.y = Y;
|
||||
s_UiPopups[g_UiNumPopups].m_Rect.w = W;
|
||||
s_UiPopups[g_UiNumPopups].m_Rect.h = H;
|
||||
s_UiPopups[g_UiNumPopups].m_pfnFunc = pfnFunc;
|
||||
s_UiPopups[g_UiNumPopups].m_pExtra = pExtra;
|
||||
g_UiNumPopups++;
|
||||
|
@ -517,7 +517,7 @@ int CEditor::PopupSelectImage(CEditor *pEditor, CUIRect View)
|
|||
}
|
||||
|
||||
if(ShowImage >= 0 && ShowImage < pEditor->m_Map.m_lImages.size())
|
||||
pEditor->Graphics()->TextureSet(pEditor->m_Map.m_lImages[ShowImage]->m_TexId);
|
||||
pEditor->Graphics()->TextureSet(pEditor->m_Map.m_lImages[ShowImage]->m_TexID);
|
||||
else
|
||||
pEditor->Graphics()->TextureSet(-1);
|
||||
pEditor->Graphics()->QuadsBegin();
|
||||
|
@ -545,6 +545,43 @@ int CEditor::PopupSelectImageResult()
|
|||
g_SelectImageSelected = -100;
|
||||
return g_SelectImageCurrent;
|
||||
}
|
||||
static int s_GametileOpSelected = -1;
|
||||
|
||||
int CEditor::PopupSelectGametileOp(CEditor *pEditor, CUIRect View)
|
||||
{
|
||||
/* This is for scripts/update_localization.py to work, don't remove!
|
||||
Localize("Clear"); Localize("Collision"); Localize("Death"); Localize("Unhookable"); */
|
||||
static const char *s_pButtonNames[] = { "Clear", "Collision", "Death", "Unhookable", "Freeze", "Unfreeze", "Deep Freeze", "Deep Unfreeze" };
|
||||
static unsigned s_NumButtons = sizeof(s_pButtonNames) / sizeof(char*);
|
||||
CUIRect Button;
|
||||
|
||||
for(unsigned i = 0; i < s_NumButtons; ++i)
|
||||
{
|
||||
View.HSplitTop(2.0f, 0, &View);
|
||||
View.HSplitTop(12.0f, &Button, &View);
|
||||
if(pEditor->DoButton_Editor(&s_pButtonNames[i], Localize(s_pButtonNames[i]), 0, &Button, 0, 0))
|
||||
s_GametileOpSelected = i;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CEditor::PopupSelectGametileOpInvoke(float x, float y)
|
||||
{
|
||||
static int s_SelectGametileOpPopupId = 0;
|
||||
s_GametileOpSelected = -1;
|
||||
UiInvokePopupMenu(&s_SelectGametileOpPopupId, 0, x, y, 120.0f, 120.0f, PopupSelectGametileOp);
|
||||
}
|
||||
|
||||
int CEditor::PopupSelectGameTileOpResult()
|
||||
{
|
||||
if(s_GametileOpSelected < 0)
|
||||
return -1;
|
||||
|
||||
int Result = s_GametileOpSelected;
|
||||
s_GametileOpSelected = -1;
|
||||
return Result;
|
||||
}
|
||||
|
||||
int CEditor::PopupTele(CEditor *pEditor, CUIRect View)
|
||||
{
|
||||
|
@ -634,4 +671,5 @@ int CEditor::PopupSwitch(CEditor *pEditor, CUIRect View)
|
|||
pEditor->m_SwitchDelay = clamp(NewVal, 0, 255);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,9 +44,9 @@ bool CTuningParams::Get(const char *pName, float *pValue)
|
|||
return false;
|
||||
}
|
||||
|
||||
float HermiteBasis1(float v)
|
||||
float HermiteBasis1(float V)
|
||||
{
|
||||
return 2*v*v*v - 3*v*v+1;
|
||||
return 2*V*V*V - 3*V*V+1;
|
||||
}
|
||||
|
||||
float VelocityRamp(float Value, float Start, float Range, float Curvature)
|
||||
|
@ -139,16 +139,16 @@ void CCharacterCore::Tick(bool UseInput)
|
|||
m_Direction = m_Input.m_Direction;
|
||||
|
||||
// setup angle
|
||||
float a = 0;
|
||||
float A = 0;
|
||||
if(m_Input.m_TargetX == 0)
|
||||
a = atanf((float)m_Input.m_TargetY);
|
||||
A = atanf((float)m_Input.m_TargetY);
|
||||
else
|
||||
a = atanf((float)m_Input.m_TargetY/(float)m_Input.m_TargetX);
|
||||
A = atanf((float)m_Input.m_TargetY/(float)m_Input.m_TargetX);
|
||||
|
||||
if(m_Input.m_TargetX < 0)
|
||||
a = a+pi;
|
||||
A = A+pi;
|
||||
|
||||
m_Angle = (int)(a*256.0f);
|
||||
m_Angle = (int)(A*256.0f);
|
||||
|
||||
// handle jump
|
||||
if(m_Input.m_Jump)
|
||||
|
@ -246,30 +246,30 @@ void CCharacterCore::Tick(bool UseInput)
|
|||
GoingToHitGround = true;
|
||||
m_pReset = true;
|
||||
}
|
||||
|
||||
|
||||
// Check against other players first
|
||||
if(m_pWorld && m_pWorld->m_Tuning.m_PlayerHooking)
|
||||
{
|
||||
float Dist = 0.0f;
|
||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
CCharacterCore *p = m_pWorld->m_apCharacters[i];
|
||||
if(!p || p == this || !m_pTeams->CanCollide(i, m_Id))
|
||||
CCharacterCore *pCharCore = m_pWorld->m_apCharacters[i];
|
||||
if(!pCharCore || pCharCore == this || !m_pTeams->CanCollide(i, m_Id))
|
||||
{
|
||||
dbg_msg1("GameCore Continue", "ThisId = %d Id = %d Team = %d", m_Id, i, m_pTeams->Team(i));
|
||||
continue;
|
||||
}
|
||||
dbg_msg1("GameCore Past Continue", "ThisId = %d Id = %d Team = %d", m_Id, i, m_pTeams->Team(i));
|
||||
|
||||
vec2 ClosestPoint = closest_point_on_line(m_HookPos, NewPos, p->m_Pos);
|
||||
if(distance(p->m_Pos, ClosestPoint) < PhysSize+2.0f)
|
||||
vec2 ClosestPoint = closest_point_on_line(m_HookPos, NewPos, pCharCore->m_Pos);
|
||||
if(distance(pCharCore->m_Pos, ClosestPoint) < PhysSize+2.0f)
|
||||
{
|
||||
if (m_HookedPlayer == -1 || distance(m_HookPos, p->m_Pos) < Dist)
|
||||
if (m_HookedPlayer == -1 || distance(m_HookPos, pCharCore->m_Pos) < Dist)
|
||||
{
|
||||
m_TriggeredEvents |= COREEVENT_HOOK_ATTACH_PLAYER;
|
||||
m_HookState = HOOK_GRABBED;
|
||||
m_HookedPlayer = i;
|
||||
Dist = distance(m_HookPos, p->m_Pos);
|
||||
Dist = distance(m_HookPos, pCharCore->m_Pos);
|
||||
dbg_msg1("GameCore Hooked", "ThisId = %d Id = %d Team = %d", m_Id, i, m_pTeams->Team(i));
|
||||
}
|
||||
}
|
||||
|
@ -298,9 +298,9 @@ void CCharacterCore::Tick(bool UseInput)
|
|||
{
|
||||
if(m_HookedPlayer != -1)
|
||||
{
|
||||
CCharacterCore *p = m_pWorld->m_apCharacters[m_HookedPlayer];
|
||||
if(p)
|
||||
m_HookPos = p->m_Pos;
|
||||
CCharacterCore *pCharCore = m_pWorld->m_apCharacters[m_HookedPlayer];
|
||||
if(pCharCore)
|
||||
m_HookPos = pCharCore->m_Pos;
|
||||
else
|
||||
{
|
||||
// release hook
|
||||
|
@ -348,25 +348,26 @@ void CCharacterCore::Tick(bool UseInput)
|
|||
}
|
||||
}
|
||||
if(m_pWorld/* && m_pWorld->m_Tuning.m_PlayerCollision*/)
|
||||
if(m_pWorld && m_pWorld->m_Tuning.m_PlayerCollision)
|
||||
{
|
||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
CCharacterCore *p = m_pWorld->m_apCharacters[i];
|
||||
if(!p)
|
||||
CCharacterCore *pCharCore = m_pWorld->m_apCharacters[i];
|
||||
if(!pCharCore)
|
||||
continue;
|
||||
|
||||
//player *p = (player*)ent;
|
||||
if(p == this || (m_Id != -1 && !m_pTeams->CanCollide(m_Id, i))) { // || !(p->flags&FLAG_ALIVE)
|
||||
if(pCharCore == this || (m_Id != -1 && !m_pTeams->CanCollide(m_Id, i))) { // || !(p->flags&FLAG_ALIVE)
|
||||
continue; // make sure that we don't nudge our self
|
||||
}
|
||||
// handle player <-> player collision
|
||||
float d = distance(m_Pos, p->m_Pos);
|
||||
vec2 Dir = normalize(m_Pos - p->m_Pos);
|
||||
float D = distance(m_Pos, pCharCore->m_Pos);
|
||||
vec2 Dir = normalize(m_Pos - pCharCore->m_Pos);
|
||||
if (m_pWorld->m_Tuning.m_PlayerCollision)
|
||||
{
|
||||
if(d < PhysSize*1.25f && d > 1.0f)
|
||||
if(D < PhysSize*1.25f && D > 1.0f)
|
||||
{
|
||||
float a = (PhysSize*1.45f - d);
|
||||
float a = (PhysSize*1.45f - D);
|
||||
float v = 0.5f;
|
||||
// make sure that we don't add excess force by checking the
|
||||
// direction against the current velocity. if not zero.
|
||||
|
@ -380,24 +381,24 @@ void CCharacterCore::Tick(bool UseInput)
|
|||
// handle hook influence
|
||||
if(m_HookedPlayer == i)
|
||||
{
|
||||
if(d > PhysSize*1.50f) // TODO: fix tweakable variable
|
||||
if(D > PhysSize*1.50f) // TODO: fix tweakable variable
|
||||
{
|
||||
float Accel = m_pWorld->m_Tuning.m_HookDragAccel * (d/m_pWorld->m_Tuning.m_HookLength);
|
||||
float Accel = m_pWorld->m_Tuning.m_HookDragAccel * (D/m_pWorld->m_Tuning.m_HookLength);
|
||||
float DragSpeed = m_pWorld->m_Tuning.m_HookDragSpeed;
|
||||
vec2 Temp = p->m_Vel;
|
||||
Temp.x = SaturatedAdd(-DragSpeed, DragSpeed, p->m_Vel.x, Accel*Dir.x*1.5f);
|
||||
Temp.y = SaturatedAdd(-DragSpeed, DragSpeed, p->m_Vel.y, Accel*Dir.y*1.5f);
|
||||
if(Temp.x > 0 && ((p->m_TileIndex == TILE_STOP && p->m_TileFlags == ROTATION_270) || (p->m_TileIndexL == TILE_STOP && p->m_TileFlagsL == ROTATION_270) || (p->m_TileIndexL == TILE_STOPS && (p->m_TileFlagsL == ROTATION_90 || p->m_TileFlagsL ==ROTATION_270)) || (p->m_TileIndexL == TILE_STOPA) || (p->m_TileFIndex == TILE_STOP && p->m_TileFFlags == ROTATION_270) || (p->m_TileFIndexL == TILE_STOP && p->m_TileFFlagsL == ROTATION_270) || (p->m_TileFIndexL == TILE_STOPS && (p->m_TileFFlagsL == ROTATION_90 || p->m_TileFFlagsL == ROTATION_270)) || (p->m_TileFIndexL == TILE_STOPA) || (p->m_TileSIndex == TILE_STOP && p->m_TileSFlags == ROTATION_270) || (p->m_TileSIndexL == TILE_STOP && p->m_TileSFlagsL == ROTATION_270) || (p->m_TileSIndexL == TILE_STOPS && (p->m_TileSFlagsL == ROTATION_90 || p->m_TileSFlagsL == ROTATION_270)) || (p->m_TileSIndexL == TILE_STOPA)))
|
||||
vec2 Temp = pCharCore->m_Vel;
|
||||
Temp.x = SaturatedAdd(-DragSpeed, DragSpeed, pCharCore->m_Vel.x, Accel*Dir.x*1.5f);
|
||||
Temp.y = SaturatedAdd(-DragSpeed, DragSpeed, pCharCore->m_Vel.y, Accel*Dir.y*1.5f);
|
||||
if(Temp.x > 0 && ((pCharCore->m_TileIndex == TILE_STOP && pCharCore->m_TileFlags == ROTATION_270) || (pCharCore->m_TileIndexL == TILE_STOP && pCharCore->m_TileFlagsL == ROTATION_270) || (pCharCore->m_TileIndexL == TILE_STOPS && (pCharCore->m_TileFlagsL == ROTATION_90 || pCharCore->m_TileFlagsL ==ROTATION_270)) || (pCharCore->m_TileIndexL == TILE_STOPA) || (pCharCore->m_TileFIndex == TILE_STOP && pCharCore->m_TileFFlags == ROTATION_270) || (pCharCore->m_TileFIndexL == TILE_STOP && pCharCore->m_TileFFlagsL == ROTATION_270) || (pCharCore->m_TileFIndexL == TILE_STOPS && (pCharCore->m_TileFFlagsL == ROTATION_90 || pCharCore->m_TileFFlagsL == ROTATION_270)) || (pCharCore->m_TileFIndexL == TILE_STOPA) || (pCharCore->m_TileSIndex == TILE_STOP && pCharCore->m_TileSFlags == ROTATION_270) || (pCharCore->m_TileSIndexL == TILE_STOP && pCharCore->m_TileSFlagsL == ROTATION_270) || (pCharCore->m_TileSIndexL == TILE_STOPS && (pCharCore->m_TileSFlagsL == ROTATION_90 || pCharCore->m_TileSFlagsL == ROTATION_270)) || (pCharCore->m_TileSIndexL == TILE_STOPA)))
|
||||
Temp.x = 0;
|
||||
if(Temp.x < 0 && ((p->m_TileIndex == TILE_STOP && p->m_TileFlags == ROTATION_90) || (p->m_TileIndexR == TILE_STOP && p->m_TileFlagsR == ROTATION_90) || (p->m_TileIndexR == TILE_STOPS && (p->m_TileFlagsR == ROTATION_90 || p->m_TileFlagsR == ROTATION_270)) || (p->m_TileIndexR == TILE_STOPA) || (p->m_TileFIndex == TILE_STOP && p->m_TileFFlags == ROTATION_90) || (p->m_TileFIndexR == TILE_STOP && p->m_TileFFlagsR == ROTATION_90) || (p->m_TileFIndexR == TILE_STOPS && (p->m_TileFFlagsR == ROTATION_90 || p->m_TileFFlagsR == ROTATION_270)) || (p->m_TileFIndexR == TILE_STOPA) || (p->m_TileSIndex == TILE_STOP && p->m_TileSFlags == ROTATION_90) || (p->m_TileSIndexR == TILE_STOP && p->m_TileSFlagsR == ROTATION_90) || (p->m_TileSIndexR == TILE_STOPS && (p->m_TileSFlagsR == ROTATION_90 || p->m_TileSFlagsR == ROTATION_270)) || (p->m_TileSIndexR == TILE_STOPA)))
|
||||
if(Temp.x < 0 && ((pCharCore->m_TileIndex == TILE_STOP && pCharCore->m_TileFlags == ROTATION_90) || (pCharCore->m_TileIndexR == TILE_STOP && pCharCore->m_TileFlagsR == ROTATION_90) || (pCharCore->m_TileIndexR == TILE_STOPS && (pCharCore->m_TileFlagsR == ROTATION_90 || pCharCore->m_TileFlagsR == ROTATION_270)) || (pCharCore->m_TileIndexR == TILE_STOPA) || (pCharCore->m_TileFIndex == TILE_STOP && pCharCore->m_TileFFlags == ROTATION_90) || (pCharCore->m_TileFIndexR == TILE_STOP && pCharCore->m_TileFFlagsR == ROTATION_90) || (pCharCore->m_TileFIndexR == TILE_STOPS && (pCharCore->m_TileFFlagsR == ROTATION_90 || pCharCore->m_TileFFlagsR == ROTATION_270)) || (pCharCore->m_TileFIndexR == TILE_STOPA) || (pCharCore->m_TileSIndex == TILE_STOP && pCharCore->m_TileSFlags == ROTATION_90) || (pCharCore->m_TileSIndexR == TILE_STOP && pCharCore->m_TileSFlagsR == ROTATION_90) || (pCharCore->m_TileSIndexR == TILE_STOPS && (pCharCore->m_TileSFlagsR == ROTATION_90 || pCharCore->m_TileSFlagsR == ROTATION_270)) || (pCharCore->m_TileSIndexR == TILE_STOPA)))
|
||||
Temp.x = 0;
|
||||
if(Temp.y < 0 && ((p->m_TileIndex == TILE_STOP && p->m_TileFlags == ROTATION_180) || (p->m_TileIndexB == TILE_STOP && p->m_TileFlagsB == ROTATION_180) || (p->m_TileIndexB == TILE_STOPS && (p->m_TileFlagsB == ROTATION_0 || p->m_TileFlagsB == ROTATION_180)) || (p->m_TileIndexB == TILE_STOPA) || (p->m_TileFIndex == TILE_STOP && p->m_TileFFlags == ROTATION_180) || (p->m_TileFIndexB == TILE_STOP && p->m_TileFFlagsB == ROTATION_180) || (p->m_TileFIndexB == TILE_STOPS && (p->m_TileFFlagsB == ROTATION_0 || p->m_TileFFlagsB == ROTATION_180)) || (p->m_TileFIndexB == TILE_STOPA) || (p->m_TileSIndex == TILE_STOP && p->m_TileSFlags == ROTATION_180) || (p->m_TileSIndexB == TILE_STOP && p->m_TileSFlagsB == ROTATION_180) || (p->m_TileSIndexB == TILE_STOPS && (p->m_TileSFlagsB == ROTATION_0 || p->m_TileSFlagsB == ROTATION_180)) || (p->m_TileSIndexB == TILE_STOPA)))
|
||||
if(Temp.y < 0 && ((pCharCore->m_TileIndex == TILE_STOP && pCharCore->m_TileFlags == ROTATION_180) || (pCharCore->m_TileIndexB == TILE_STOP && pCharCore->m_TileFlagsB == ROTATION_180) || (pCharCore->m_TileIndexB == TILE_STOPS && (pCharCore->m_TileFlagsB == ROTATION_0 || pCharCore->m_TileFlagsB == ROTATION_180)) || (pCharCore->m_TileIndexB == TILE_STOPA) || (pCharCore->m_TileFIndex == TILE_STOP && pCharCore->m_TileFFlags == ROTATION_180) || (pCharCore->m_TileFIndexB == TILE_STOP && pCharCore->m_TileFFlagsB == ROTATION_180) || (pCharCore->m_TileFIndexB == TILE_STOPS && (pCharCore->m_TileFFlagsB == ROTATION_0 || pCharCore->m_TileFFlagsB == ROTATION_180)) || (pCharCore->m_TileFIndexB == TILE_STOPA) || (pCharCore->m_TileSIndex == TILE_STOP && pCharCore->m_TileSFlags == ROTATION_180) || (pCharCore->m_TileSIndexB == TILE_STOP && pCharCore->m_TileSFlagsB == ROTATION_180) || (pCharCore->m_TileSIndexB == TILE_STOPS && (pCharCore->m_TileSFlagsB == ROTATION_0 || pCharCore->m_TileSFlagsB == ROTATION_180)) || (pCharCore->m_TileSIndexB == TILE_STOPA)))
|
||||
Temp.y = 0;
|
||||
if(Temp.y > 0 && ((p->m_TileIndex == TILE_STOP && p->m_TileFlags == ROTATION_0) || (p->m_TileIndexT == TILE_STOP && p->m_TileFlagsT == ROTATION_0) || (p->m_TileIndexT == TILE_STOPS && (p->m_TileFlagsT == ROTATION_0 || p->m_TileFlagsT == ROTATION_180)) || (p->m_TileIndexT == TILE_STOPA) || (p->m_TileFIndex == TILE_STOP && p->m_TileFFlags == ROTATION_0) || (p->m_TileFIndexT == TILE_STOP && p->m_TileFFlagsT == ROTATION_0) || (p->m_TileFIndexT == TILE_STOPS && (p->m_TileFFlagsT == ROTATION_0 || p->m_TileFFlagsT == ROTATION_180)) || (p->m_TileFIndexT == TILE_STOPA) || (p->m_TileSIndex == TILE_STOP && p->m_TileSFlags == ROTATION_0) || (p->m_TileSIndexT == TILE_STOP && p->m_TileSFlagsT == ROTATION_0) || (p->m_TileSIndexT == TILE_STOPS && (p->m_TileSFlagsT == ROTATION_0 || p->m_TileSFlagsT == ROTATION_180)) || (p->m_TileSIndexT == TILE_STOPA)))
|
||||
if(Temp.y > 0 && ((pCharCore->m_TileIndex == TILE_STOP && pCharCore->m_TileFlags == ROTATION_0) || (pCharCore->m_TileIndexT == TILE_STOP && pCharCore->m_TileFlagsT == ROTATION_0) || (pCharCore->m_TileIndexT == TILE_STOPS && (pCharCore->m_TileFlagsT == ROTATION_0 || pCharCore->m_TileFlagsT == ROTATION_180)) || (pCharCore->m_TileIndexT == TILE_STOPA) || (pCharCore->m_TileFIndex == TILE_STOP && pCharCore->m_TileFFlags == ROTATION_0) || (pCharCore->m_TileFIndexT == TILE_STOP && pCharCore->m_TileFFlagsT == ROTATION_0) || (pCharCore->m_TileFIndexT == TILE_STOPS && (pCharCore->m_TileFFlagsT == ROTATION_0 || pCharCore->m_TileFFlagsT == ROTATION_180)) || (pCharCore->m_TileFIndexT == TILE_STOPA) || (pCharCore->m_TileSIndex == TILE_STOP && pCharCore->m_TileSFlags == ROTATION_0) || (pCharCore->m_TileSIndexT == TILE_STOP && pCharCore->m_TileSFlagsT == ROTATION_0) || (pCharCore->m_TileSIndexT == TILE_STOPS && (pCharCore->m_TileSFlagsT == ROTATION_0 || pCharCore->m_TileSFlagsT == ROTATION_180)) || (pCharCore->m_TileSIndexT == TILE_STOPA)))
|
||||
Temp.y = 0;
|
||||
|
||||
// add force to the hooked player
|
||||
p->m_Vel = Temp;
|
||||
pCharCore->m_Vel = Temp;
|
||||
Temp.x = SaturatedAdd(-DragSpeed, DragSpeed, m_Vel.x, -Accel*Dir.x*0.25f);
|
||||
Temp.y = SaturatedAdd(-DragSpeed, DragSpeed, m_Vel.y, -Accel*Dir.y*0.25f);
|
||||
if(Temp.x > 0 && ((m_TileIndex == TILE_STOP && m_TileFlags == ROTATION_270) || (m_TileIndexL == TILE_STOP && m_TileFlagsL == ROTATION_270) || (m_TileIndexL == TILE_STOPS && (m_TileFlagsL == ROTATION_90 || m_TileFlagsL ==ROTATION_270)) || (m_TileIndexL == TILE_STOPA) || (m_TileFIndex == TILE_STOP && m_TileFFlags == ROTATION_270) || (m_TileFIndexL == TILE_STOP && m_TileFFlagsL == ROTATION_270) || (m_TileFIndexL == TILE_STOPS && (m_TileFFlagsL == ROTATION_90 || m_TileFFlagsL == ROTATION_270)) || (m_TileFIndexL == TILE_STOPA) || (m_TileSIndex == TILE_STOP && m_TileSFlags == ROTATION_270) || (m_TileSIndexL == TILE_STOP && m_TileSFlagsL == ROTATION_270) || (m_TileSIndexL == TILE_STOPS && (m_TileSFlagsL == ROTATION_90 || m_TileSFlagsL == ROTATION_270)) || (m_TileSIndexL == TILE_STOPA)))
|
||||
|
|
|
@ -56,19 +56,19 @@ inline vec2 GetDirection(int Angle)
|
|||
return vec2(cosf(a), sinf(a));
|
||||
}
|
||||
|
||||
inline vec2 GetDir(float a)
|
||||
inline vec2 GetDir(float A)
|
||||
{
|
||||
return vec2(cosf(a), sinf(a));
|
||||
return vec2(cosf(A), sinf(A));
|
||||
}
|
||||
|
||||
inline float GetAngle(vec2 Dir)
|
||||
{
|
||||
if(Dir.x == 0 && Dir.y == 0)
|
||||
return 0.0f;
|
||||
float a = atanf(Dir.y/Dir.x);
|
||||
float A = atanf(Dir.y/Dir.x);
|
||||
if(Dir.x < 0)
|
||||
a = a+pi;
|
||||
return a;
|
||||
A = A+pi;
|
||||
return A;
|
||||
}
|
||||
|
||||
inline void StrToInts(int *pInts, int Num, const char *pStr)
|
||||
|
@ -107,13 +107,13 @@ inline void IntsToStr(const int *pInts, int Num, char *pStr)
|
|||
|
||||
|
||||
|
||||
inline vec2 CalcPos(vec2 p, vec2 v, float Curvature, float Speed, float t)
|
||||
inline vec2 CalcPos(vec2 P, vec2 V, float Curvature, float Speed, float T)
|
||||
{
|
||||
vec2 n;
|
||||
t *= Speed;
|
||||
n.x = p.x + v.x*t;
|
||||
n.y = p.y + v.y*t + Curvature/10000*(t*t);
|
||||
return n;
|
||||
vec2 N;
|
||||
T *= Speed;
|
||||
N.x = P.x + V.x*T;
|
||||
N.y = P.y + V.y*T + Curvature/10000*(T*T);
|
||||
return N;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ bool CLocalizationDatabase::Load(const char *pFilename, IStorage *pStorage, ICon
|
|||
pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "localization", aBuf);
|
||||
m_Strings.clear();
|
||||
|
||||
char aOrigin[512];
|
||||
CLineReader LineReader;
|
||||
LineReader.Init(IoHandle);
|
||||
char *pLine;
|
||||
|
@ -74,6 +75,7 @@ bool CLocalizationDatabase::Load(const char *pFilename, IStorage *pStorage, ICon
|
|||
if(pLine[0] == '#') // skip comments
|
||||
continue;
|
||||
|
||||
str_copy(aOrigin, pLine, sizeof(aOrigin));
|
||||
char *pReplacement = LineReader.Get();
|
||||
if(!pReplacement)
|
||||
{
|
||||
|
@ -83,13 +85,13 @@ bool CLocalizationDatabase::Load(const char *pFilename, IStorage *pStorage, ICon
|
|||
|
||||
if(pReplacement[0] != '=' || pReplacement[1] != '=' || pReplacement[2] != ' ')
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "malform replacement line for '%s'", pLine);
|
||||
str_format(aBuf, sizeof(aBuf), "malform replacement line for '%s'", aOrigin);
|
||||
pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "localization", aBuf);
|
||||
continue;
|
||||
}
|
||||
|
||||
pReplacement += 3;
|
||||
AddString(pLine, pReplacement);
|
||||
AddString(aOrigin, pReplacement);
|
||||
}
|
||||
io_close(IoHandle);
|
||||
|
||||
|
|
|
@ -72,8 +72,8 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
|
|||
m_Pos = Pos;
|
||||
|
||||
m_Core.Reset();
|
||||
|
||||
m_Core.Init(&GameServer()->m_World.m_Core, GameServer()->Collision(), &((CGameControllerDDRace*)GameServer()->m_pController)->m_Teams.m_Core);
|
||||
|
||||
m_Core.m_Pos = m_Pos;
|
||||
GameServer()->m_World.m_Core.m_apCharacters[m_pPlayer->GetCID()] = &m_Core;
|
||||
|
||||
|
@ -93,7 +93,7 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
|
|||
|
||||
void CCharacter::Destroy()
|
||||
{
|
||||
//GameServer()->m_World.m_Core.m_apCharacters[m_MarkedId] = 0; This caused the Marked Char for delete to always Delete ID 0 Core
|
||||
//GameServer()->m_World.m_Core.m_apCharacters[m_pPlayer->GetCID()] = 0;
|
||||
//dbg_msg("CCHaracter::Destroy", "ID %d Player %d m_Core %d", GetPlayer()->GetCID() ,GetPlayer() ,&m_Core);
|
||||
m_Alive = false;
|
||||
CEntity::Destroy();
|
||||
|
@ -223,7 +223,7 @@ void CCharacter::HandleWeaponSwitch()
|
|||
if(m_QueuedWeapon != -1)
|
||||
WantedWeapon = m_QueuedWeapon;
|
||||
|
||||
bool Anything;
|
||||
bool Anything = false;
|
||||
for(int i = 0; i < NUM_WEAPONS - 1; ++i)
|
||||
if(m_aWeapons[i].m_Got)
|
||||
Anything = true;
|
||||
|
@ -942,14 +942,13 @@ void CCharacter::Snap(int SnappingClient)
|
|||
|
||||
pCharacter->m_PlayerState = m_PlayerState;
|
||||
}
|
||||
|
||||
bool CCharacter::CanCollide(int Cid)
|
||||
bool CCharacter::CanCollide(int ClientID)
|
||||
{
|
||||
return Teams()->m_Core.CanCollide(GetPlayer()->GetCID(), Cid);
|
||||
return Teams()->m_Core.CanCollide(GetPlayer()->GetCID(), ClientID);
|
||||
}
|
||||
bool CCharacter::SameTeam(int Cid)
|
||||
bool CCharacter::SameTeam(int ClientID)
|
||||
{
|
||||
return Teams()->m_Core.SameTeam(GetPlayer()->GetCID(), Cid);
|
||||
return Teams()->m_Core.SameTeam(GetPlayer()->GetCID(), ClientID);
|
||||
}
|
||||
|
||||
void CCharacter::OnFinish()
|
||||
|
@ -1024,7 +1023,7 @@ void CCharacter::OnFinish()
|
|||
{
|
||||
CNetMsg_Sv_PlayerTime Msg;
|
||||
Msg.m_Time = time * 100.0;
|
||||
Msg.m_Cid = m_pPlayer->GetCID();
|
||||
Msg.m_ClientID = m_pPlayer->GetCID();
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, i);
|
||||
}
|
||||
}
|
||||
|
@ -1365,14 +1364,10 @@ void CCharacter::HandleTiles(int Index)
|
|||
Freeze();
|
||||
else if(((m_TileIndex == TILE_UNFREEZE) || (m_TileFIndex == TILE_UNFREEZE)) && !m_DeepFreeze)
|
||||
UnFreeze();
|
||||
else if(((m_TileIndex == TILE_DFREEZE) || (m_TileFIndex == TILE_DFREEZE)) && !m_Super && !m_DeepFreeze)
|
||||
if(((m_TileIndex == TILE_DFREEZE) || (m_TileFIndex == TILE_DFREEZE)) && !m_Super && !m_DeepFreeze)
|
||||
m_DeepFreeze = true;
|
||||
else if(((m_TileIndex == TILE_DUNFREEZE) || (m_TileFIndex == TILE_DUNFREEZE)) && !m_Super && m_DeepFreeze)
|
||||
{
|
||||
if((m_TileIndex != TILE_FREEZE) && (m_TileFIndex != TILE_FREEZE))
|
||||
UnFreeze();
|
||||
m_DeepFreeze = false;
|
||||
}
|
||||
if(((m_TileIndex == TILE_EHOOK_START) || (m_TileFIndex == TILE_EHOOK_START)) && !m_EndlessHook)
|
||||
{
|
||||
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"Endless hook has been activated");
|
||||
|
|
|
@ -151,8 +151,8 @@ public:
|
|||
int m_DDRaceState;
|
||||
void OnFinish();
|
||||
int Team();
|
||||
bool CanCollide(int Cid);
|
||||
bool SameTeam(int Cid);
|
||||
bool CanCollide(int ClientID);
|
||||
bool SameTeam(int ClientID);
|
||||
int m_HammerType;
|
||||
bool m_Super;
|
||||
int m_TeamBeforeSuper;
|
||||
|
|
|
@ -63,7 +63,7 @@ void CDoor::Snap(int SnappingClient)
|
|||
if(NetworkClipped(SnappingClient, m_Pos) && NetworkClipped(SnappingClient, m_To))
|
||||
return;
|
||||
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
|
||||
pObj->m_X = (int)m_Pos.x;
|
||||
pObj->m_Y = (int)m_Pos.y;
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ void CDragger::Snap(int SnappingClient)
|
|||
if (Char && Char->IsAlive() && (m_Layer == LAYER_SWITCH && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[Char->Team()] && (!Tick))) return;
|
||||
if(Char && Char->IsAlive() && m_Target && m_Target->IsAlive() && Char->Team() != m_Target->Team()) return;
|
||||
|
||||
CNetObj_Laser *obj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
||||
CNetObj_Laser *obj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
|
||||
|
||||
obj->m_X = (int)m_Pos.x;
|
||||
obj->m_Y = (int)m_Pos.y;
|
||||
|
|
|
@ -26,4 +26,4 @@ public:
|
|||
};
|
||||
|
||||
#endif
|
||||
*/
|
||||
*/
|
||||
|
|
|
@ -96,7 +96,7 @@ void CGun::Snap(int SnappingClient)
|
|||
CCharacter * SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||
int Tick = (Server()->Tick()%Server()->TickSpeed())%11;
|
||||
if (SnapChar && SnapChar->IsAlive() && (m_Layer == LAYER_SWITCH && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()]) && (!Tick)) return;
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
|
||||
pObj->m_X = (int)m_Pos.x;
|
||||
pObj->m_Y = (int)m_Pos.y;
|
||||
pObj->m_FromX = (int)m_Pos.x;
|
||||
|
|
|
@ -140,7 +140,7 @@ void CLaser::Snap(int SnappingClient)
|
|||
return;
|
||||
if(SnappingChar->IsAlive() && OwnerChar->IsAlive() && SnappingChar->Team() != OwnerChar->Team())
|
||||
return;
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
|
||||
if(!pObj)
|
||||
return;
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ void CLight::Snap(int SnappingClient)
|
|||
if(m_Layer == LAYER_SWITCH && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[Char->Team()] && (Tick)) return;
|
||||
|
||||
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
|
||||
pObj->m_X = (int)m_Pos.x;
|
||||
pObj->m_Y = (int)m_Pos.y;
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ void CPickup::Snap(int SnappingClient)
|
|||
CCharacter * SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||
int Tick = (Server()->Tick()%Server()->TickSpeed())%11;
|
||||
if (SnapChar && SnapChar->IsAlive() && (m_Layer == LAYER_SWITCH && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()]) && (!Tick)) return;
|
||||
CNetObj_Pickup *pP = static_cast<CNetObj_Pickup *>(Server()->SnapNewItem(NETOBJTYPE_PICKUP, m_Id, sizeof(CNetObj_Pickup)));
|
||||
CNetObj_Pickup *pP = static_cast<CNetObj_Pickup *>(Server()->SnapNewItem(NETOBJTYPE_PICKUP, m_ID, sizeof(CNetObj_Pickup)));
|
||||
if(!pP)
|
||||
return;
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ void CPlasma::Snap(int SnappingClient)
|
|||
if(!SnapChar) return;
|
||||
if (SnapChar->IsAlive() && (m_Layer == LAYER_SWITCH && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()]) && (!Tick)) return;
|
||||
if((SnapChar->Team() != m_ResponsibleTeam) && (!SnapChar->GetPlayer()->m_IsUsingDDRaceClient || (GameServer()->m_apPlayers[SnappingClient]->m_IsUsingDDRaceClient && !GameServer()->m_apPlayers[SnappingClient]->m_ShowOthers))) return;
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
|
||||
pObj->m_X = (int)m_Pos.x;
|
||||
pObj->m_Y = (int)m_Pos.y;
|
||||
pObj->m_FromX = (int)m_Pos.x;
|
||||
|
|
|
@ -182,7 +182,7 @@ void CProjectile::Snap(int SnappingClient)
|
|||
!SnapChar->CanCollide(m_Owner)
|
||||
)
|
||||
return;
|
||||
CNetObj_Projectile *pProj = static_cast<CNetObj_Projectile *>(Server()->SnapNewItem(NETOBJTYPE_PROJECTILE, m_Id, sizeof(CNetObj_Projectile)));
|
||||
CNetObj_Projectile *pProj = static_cast<CNetObj_Projectile *>(Server()->SnapNewItem(NETOBJTYPE_PROJECTILE, m_ID, sizeof(CNetObj_Projectile)));
|
||||
if(pProj)
|
||||
FillInfo(pProj);
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@ CEntity::CEntity(CGameWorld *pGameWorld, int ObjType)
|
|||
m_ProximityRadius = 0;
|
||||
|
||||
m_MarkedForDestroy = false;
|
||||
m_Id = Server()->SnapNewID();
|
||||
m_ID = Server()->SnapNewID();
|
||||
|
||||
m_pPrevTypeEntity = 0;
|
||||
m_pNextTypeEntity = 0;
|
||||
|
@ -25,7 +25,7 @@ CEntity::CEntity(CGameWorld *pGameWorld, int ObjType)
|
|||
CEntity::~CEntity()
|
||||
{
|
||||
GameWorld()->RemoveEntity(this);
|
||||
Server()->SnapFreeID(m_Id);
|
||||
Server()->SnapFreeID(m_ID);
|
||||
}
|
||||
|
||||
int CEntity::NetworkClipped(int SnappingClient)
|
||||
|
|
|
@ -65,7 +65,7 @@ class CEntity
|
|||
class CGameWorld *m_pGameWorld;
|
||||
protected:
|
||||
bool m_MarkedForDestroy;
|
||||
int m_Id;
|
||||
int m_ID;
|
||||
int m_ObjType;
|
||||
int m_Number;
|
||||
int m_Layer;
|
||||
|
@ -77,7 +77,7 @@ public:
|
|||
class CGameContext *GameServer() { return GameWorld()->GameServer(); }
|
||||
class IServer *Server() { return GameWorld()->Server(); }
|
||||
|
||||
CEntity *TypeNext() { return m_pNextTypeEntity; }
|
||||
CEntity *TypeNext() { return m_pNextTypeEntity; }
|
||||
CEntity *TypePrev() { return m_pPrevTypeEntity; }
|
||||
|
||||
/*
|
||||
|
|
|
@ -94,65 +94,64 @@ void CGameContext::Clear()
|
|||
}
|
||||
|
||||
|
||||
class CCharacter *CGameContext::GetPlayerChar(int ClientId)
|
||||
class CCharacter *CGameContext::GetPlayerChar(int ClientID)
|
||||
{
|
||||
if(ClientId < 0 || ClientId >= MAX_CLIENTS || !m_apPlayers[ClientId])
|
||||
if(ClientID < 0 || ClientID >= MAX_CLIENTS || !m_apPlayers[ClientID])
|
||||
return 0;
|
||||
return m_apPlayers[ClientId]->GetCharacter();
|
||||
return m_apPlayers[ClientID]->GetCharacter();
|
||||
}
|
||||
|
||||
void CGameContext::CreateDamageInd(vec2 p, float Angle, int Amount, int Mask)
|
||||
void CGameContext::CreateDamageInd(vec2 Pos, float Angle, int Amount, int Mask)
|
||||
{
|
||||
float a = 3 * 3.14159f / 2 + Angle;
|
||||
float A = 3 * 3.14159f / 2 + Angle;
|
||||
//float a = get_angle(dir);
|
||||
float s = a-pi/3;
|
||||
float e = a+pi/3;
|
||||
float S = A-pi/3;
|
||||
float E = A+pi/3;
|
||||
for(int i = 0; i < Amount; i++)
|
||||
{
|
||||
float f = mix(s, e, float(i+1)/float(Amount+2));
|
||||
NETEVENT_DAMAGEIND *ev = (NETEVENT_DAMAGEIND *)m_Events.Create(NETEVENTTYPE_DAMAGEIND, sizeof(NETEVENT_DAMAGEIND), Mask);
|
||||
if(ev)
|
||||
float F = mix(S, E, float(i+1)/float(Amount+2));
|
||||
NETEVENT_DAMAGEIND *pEvent = (NETEVENT_DAMAGEIND *)m_Events.Create(NETEVENTTYPE_DAMAGEIND, sizeof(NETEVENT_DAMAGEIND), Mask);
|
||||
if(pEvent)
|
||||
{
|
||||
ev->m_X = (int)p.x;
|
||||
ev->m_Y = (int)p.y;
|
||||
ev->m_Angle = (int)(f*256.0f);
|
||||
pEvent->m_X = (int)Pos.x;
|
||||
pEvent->m_Y = (int)Pos.y;
|
||||
pEvent->m_Angle = (int)(F*256.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CGameContext::CreateHammerHit(vec2 p, int Mask)
|
||||
void CGameContext::CreateHammerHit(vec2 Pos, int Mask)
|
||||
{
|
||||
// create the event
|
||||
NETEVENT_HAMMERHIT *ev = (NETEVENT_HAMMERHIT *)m_Events.Create(NETEVENTTYPE_HAMMERHIT, sizeof(NETEVENT_HAMMERHIT), Mask);
|
||||
if(ev)
|
||||
NETEVENT_HAMMERHIT *pEvent = (NETEVENT_HAMMERHIT *)m_Events.Create(NETEVENTTYPE_HAMMERHIT, sizeof(NETEVENT_HAMMERHIT), Mask);
|
||||
if(pEvent)
|
||||
{
|
||||
ev->m_X = (int)p.x;
|
||||
ev->m_Y = (int)p.y;
|
||||
pEvent->m_X = (int)Pos.x;
|
||||
pEvent->m_Y = (int)Pos.y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CGameContext::CreateExplosion(vec2 p, int Owner, int Weapon, bool NoDamage, int ActivatedTeam,int Mask)
|
||||
void CGameContext::CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamage, int ActivatedTeam,int Mask)
|
||||
{
|
||||
// create the event
|
||||
NETEVENT_EXPLOSION *ev = (NETEVENT_EXPLOSION *)m_Events.Create(NETEVENTTYPE_EXPLOSION, sizeof(NETEVENT_EXPLOSION), Mask);
|
||||
if(ev)
|
||||
NETEVENT_EXPLOSION *pEvent = (NETEVENT_EXPLOSION *)m_Events.Create(NETEVENTTYPE_EXPLOSION, sizeof(NETEVENT_EXPLOSION), Mask);
|
||||
if(pEvent)
|
||||
{
|
||||
ev->m_X = (int)p.x;
|
||||
ev->m_Y = (int)p.y;
|
||||
pEvent->m_X = (int)Pos.x;
|
||||
pEvent->m_Y = (int)Pos.y;
|
||||
}
|
||||
|
||||
/*
|
||||
if(!NoDamage)
|
||||
{*/
|
||||
if (!NoDamage)
|
||||
{
|
||||
// deal damage
|
||||
CCharacter *apEnts[MAX_CLIENTS];
|
||||
float Radius = 135.0f;
|
||||
float InnerRadius = 48.0f;
|
||||
int Num = m_World.FindEntities(p, Radius, (CEntity**)apEnts, MAX_CLIENTS, CGameWorld::ENTTYPE_CHARACTER);
|
||||
int Num = m_World.FindEntities(Pos, Radius, (CEntity**)apEnts, MAX_CLIENTS, CGameWorld::ENTTYPE_CHARACTER);
|
||||
for(int i = 0; i < Num; i++)
|
||||
{
|
||||
vec2 Diff = apEnts[i]->m_Pos - p;
|
||||
vec2 Diff = apEnts[i]->m_Pos - Pos;
|
||||
vec2 ForceDir(0,1);
|
||||
float l = length(Diff);
|
||||
if(l)
|
||||
|
@ -168,40 +167,41 @@ void CGameContext::CreateExplosion(vec2 p, int Owner, int Weapon, bool NoDamage,
|
|||
if(!g_Config.m_SvHit||NoDamage) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void create_smoke(vec2 p)
|
||||
void create_smoke(vec2 P)
|
||||
{
|
||||
// create the event
|
||||
EV_EXPLOSION *ev = (EV_EXPLOSION *)events.create(EVENT_SMOKE, sizeof(EV_EXPLOSION));
|
||||
if(ev)
|
||||
EV_EXPLOSION *pEvent = (EV_EXPLOSION *)events.create(EVENT_SMOKE, sizeof(EV_EXPLOSION));
|
||||
if(pEvent)
|
||||
{
|
||||
ev->x = (int)p.x;
|
||||
ev->y = (int)p.y;
|
||||
pEvent->x = (int)P.x;
|
||||
pEvent->y = (int)P.y;
|
||||
}
|
||||
}*/
|
||||
|
||||
void CGameContext::CreatePlayerSpawn(vec2 p, int Mask)
|
||||
void CGameContext::CreatePlayerSpawn(vec2 Pos, int Mask)
|
||||
{
|
||||
// create the event
|
||||
NETEVENT_SPAWN *ev = (NETEVENT_SPAWN *)m_Events.Create(NETEVENTTYPE_SPAWN, sizeof(NETEVENT_SPAWN), Mask);
|
||||
NETEVENT_SPAWN *ev = (NETEVENT_SPAWN *)m_Events.Create(NETEVENTTYPE_SPAWN, sizeof(NETEVENT_SPAWN));
|
||||
if(ev)
|
||||
{
|
||||
ev->m_X = (int)p.x;
|
||||
ev->m_Y = (int)p.y;
|
||||
ev->m_X = (int)Pos.x;
|
||||
ev->m_Y = (int)Pos.y;
|
||||
}
|
||||
}
|
||||
|
||||
void CGameContext::CreateDeath(vec2 p, int ClientId, int Mask)
|
||||
void CGameContext::CreateDeath(vec2 Pos, int ClientID, int Mask)
|
||||
{
|
||||
// create the event
|
||||
NETEVENT_DEATH *ev = (NETEVENT_DEATH *)m_Events.Create(NETEVENTTYPE_DEATH, sizeof(NETEVENT_DEATH), Mask);
|
||||
if(ev)
|
||||
NETEVENT_DEATH *pEvent = (NETEVENT_DEATH *)m_Events.Create(NETEVENTTYPE_DEATH, sizeof(NETEVENT_DEATH), Mask);
|
||||
if(pEvent)
|
||||
{
|
||||
ev->m_X = (int)p.x;
|
||||
ev->m_Y = (int)p.y;
|
||||
ev->m_ClientId = ClientId;
|
||||
pEvent->m_X = (int)Pos.x;
|
||||
pEvent->m_Y = (int)Pos.y;
|
||||
pEvent->m_ClientID = ClientID;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,12 +211,12 @@ void CGameContext::CreateSound(vec2 Pos, int Sound, int Mask)
|
|||
return;
|
||||
|
||||
// create a sound
|
||||
NETEVENT_SOUNDWORLD *ev = (NETEVENT_SOUNDWORLD *)m_Events.Create(NETEVENTTYPE_SOUNDWORLD, sizeof(NETEVENT_SOUNDWORLD), Mask);
|
||||
if(ev)
|
||||
NETEVENT_SOUNDWORLD *pEvent = (NETEVENT_SOUNDWORLD *)m_Events.Create(NETEVENTTYPE_SOUNDWORLD, sizeof(NETEVENT_SOUNDWORLD), Mask);
|
||||
if(pEvent)
|
||||
{
|
||||
ev->m_X = (int)Pos.x;
|
||||
ev->m_Y = (int)Pos.y;
|
||||
ev->m_SoundId = Sound;
|
||||
pEvent->m_X = (int)Pos.x;
|
||||
pEvent->m_Y = (int)Pos.y;
|
||||
pEvent->m_SoundID = Sound;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ void CGameContext::CreateSoundGlobal(int Sound, int Target)
|
|||
return;
|
||||
|
||||
CNetMsg_Sv_SoundGlobal Msg;
|
||||
Msg.m_Soundid = Sound;
|
||||
Msg.m_SoundID = Sound;
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, Target);
|
||||
}
|
||||
|
||||
|
@ -235,32 +235,32 @@ void CGameContext::SendChatTarget(int To, const char *pText)
|
|||
{
|
||||
CNetMsg_Sv_Chat Msg;
|
||||
Msg.m_Team = 0;
|
||||
Msg.m_Cid = -1;
|
||||
Msg.m_ClientID = -1;
|
||||
Msg.m_pMessage = pText;
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, To);
|
||||
}
|
||||
|
||||
|
||||
void CGameContext::SendChat(int ChatterClientId, int Team, const char *pText, int SpamProtectionClientId)
|
||||
void CGameContext::SendChat(int ChatterClientID, int Team, const char *pText, int SpamProtectionClientID)
|
||||
{
|
||||
if(SpamProtectionClientId >= 0 && SpamProtectionClientId < MAX_CLIENTS)
|
||||
if(SpamProtectionClientID >= 0 && SpamProtectionClientID < MAX_CLIENTS)
|
||||
{
|
||||
if(g_Config.m_SvSpamprotection && m_apPlayers[SpamProtectionClientId]->m_Last_Chat
|
||||
&& m_apPlayers[SpamProtectionClientId]->m_Last_Chat + Server()->TickSpeed() + g_Config.m_SvChatDelay > Server()->Tick())
|
||||
if(g_Config.m_SvSpamprotection && m_apPlayers[SpamProtectionClientID]->m_Last_Chat
|
||||
&& m_apPlayers[SpamProtectionClientID]->m_Last_Chat + Server()->TickSpeed() + g_Config.m_SvChatDelay > Server()->Tick())
|
||||
return;
|
||||
else
|
||||
m_apPlayers[SpamProtectionClientId]->m_Last_Chat = Server()->Tick();
|
||||
m_apPlayers[SpamProtectionClientID]->m_Last_Chat = Server()->Tick();
|
||||
}
|
||||
|
||||
char aBuf[256], aText[256];
|
||||
str_copy(aText, pText, sizeof(aText));
|
||||
if(ChatterClientId >= 0 && ChatterClientId < MAX_CLIENTS)
|
||||
str_format(aBuf, sizeof(aBuf), "%d:%d:%s: %s", ChatterClientId, Team, Server()->ClientName(ChatterClientId), aText);
|
||||
else if(ChatterClientId == -2)
|
||||
if(ChatterClientID >= 0 && ChatterClientID < MAX_CLIENTS)
|
||||
str_format(aBuf, sizeof(aBuf), "%d:%d:%s: %s", ChatterClientID, Team, Server()->ClientName(ChatterClientID), aText);
|
||||
else if(ChatterClientID == -2)
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "### %s", aText);
|
||||
str_copy(aText, aBuf, sizeof(aText));
|
||||
ChatterClientId = -1;
|
||||
ChatterClientID = -1;
|
||||
}
|
||||
else
|
||||
str_format(aBuf, sizeof(aBuf), "*** %s", aText);
|
||||
|
@ -270,7 +270,7 @@ void CGameContext::SendChat(int ChatterClientId, int Team, const char *pText, in
|
|||
{
|
||||
CNetMsg_Sv_Chat Msg;
|
||||
Msg.m_Team = 0;
|
||||
Msg.m_Cid = ChatterClientId;
|
||||
Msg.m_ClientID = ChatterClientID;
|
||||
Msg.m_pMessage = aText;
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, -1);
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ void CGameContext::SendChat(int ChatterClientId, int Team, const char *pText, in
|
|||
CTeamsCore * Teams = &((CGameControllerDDRace*)m_pController)->m_Teams.m_Core;
|
||||
CNetMsg_Sv_Chat Msg;
|
||||
Msg.m_Team = 1;
|
||||
Msg.m_Cid = ChatterClientId;
|
||||
Msg.m_ClientID = ChatterClientID;
|
||||
Msg.m_pMessage = aText;
|
||||
|
||||
// pack one for the recording only
|
||||
|
@ -303,27 +303,27 @@ void CGameContext::SendChat(int ChatterClientId, int Team, const char *pText, in
|
|||
}
|
||||
}
|
||||
|
||||
void CGameContext::SendEmoticon(int ClientId, int Emoticon)
|
||||
void CGameContext::SendEmoticon(int ClientID, int Emoticon)
|
||||
{
|
||||
CNetMsg_Sv_Emoticon Msg;
|
||||
Msg.m_Cid = ClientId;
|
||||
Msg.m_ClientID = ClientID;
|
||||
Msg.m_Emoticon = Emoticon;
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, -1);
|
||||
}
|
||||
|
||||
void CGameContext::SendWeaponPickup(int ClientId, int Weapon)
|
||||
void CGameContext::SendWeaponPickup(int ClientID, int Weapon)
|
||||
{
|
||||
CNetMsg_Sv_WeaponPickup Msg;
|
||||
Msg.m_Weapon = Weapon;
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientId);
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientID);
|
||||
}
|
||||
|
||||
|
||||
void CGameContext::SendBroadcast(const char *pText, int ClientId)
|
||||
void CGameContext::SendBroadcast(const char *pText, int ClientID)
|
||||
{
|
||||
CNetMsg_Sv_Broadcast Msg;
|
||||
Msg.m_pMessage = pText;
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientId);
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientID);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -359,7 +359,7 @@ void CGameContext::EndVote()
|
|||
SendVoteSet(-1);
|
||||
}
|
||||
|
||||
void CGameContext::SendVoteSet(int ClientId)
|
||||
void CGameContext::SendVoteSet(int ClientID)
|
||||
{
|
||||
CNetMsg_Sv_VoteSet Msg;
|
||||
if(m_VoteCloseTime)
|
||||
|
@ -374,10 +374,10 @@ void CGameContext::SendVoteSet(int ClientId)
|
|||
Msg.m_pDescription = "";
|
||||
Msg.m_pCommand = "";
|
||||
}
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientId);
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientID);
|
||||
}
|
||||
|
||||
void CGameContext::SendVoteStatus(int ClientId, int Total, int Yes, int No)
|
||||
void CGameContext::SendVoteStatus(int ClientID, int Total, int Yes, int No)
|
||||
{
|
||||
CNetMsg_Sv_VoteStatus Msg = {0};
|
||||
Msg.m_Total = Total;
|
||||
|
@ -385,13 +385,13 @@ void CGameContext::SendVoteStatus(int ClientId, int Total, int Yes, int No)
|
|||
Msg.m_No = No;
|
||||
Msg.m_Pass = Total - (Yes+No);
|
||||
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientId);
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientID);
|
||||
|
||||
}
|
||||
|
||||
void CGameContext::AbortVoteKickOnDisconnect(int ClientId)
|
||||
void CGameContext::AbortVoteKickOnDisconnect(int ClientID)
|
||||
{
|
||||
if(m_VoteCloseTime && !str_comp_num(m_aVoteCommand, "kick ", 5) && str_toint(&m_aVoteCommand[5]) == ClientId)
|
||||
if(m_VoteCloseTime && !str_comp_num(m_aVoteCommand, "kick ", 5) && str_toint(&m_aVoteCommand[5]) == ClientID)
|
||||
m_VoteCloseTime = -1;
|
||||
}
|
||||
|
||||
|
@ -415,7 +415,7 @@ void CGameContext::CheckPureTuning()
|
|||
}
|
||||
}
|
||||
|
||||
void CGameContext::SendTuningParams(int Cid)
|
||||
void CGameContext::SendTuningParams(int ClientID)
|
||||
{
|
||||
CheckPureTuning();
|
||||
|
||||
|
@ -423,7 +423,7 @@ void CGameContext::SendTuningParams(int Cid)
|
|||
int *pParams = (int *)&m_Tuning;
|
||||
for(unsigned i = 0; i < sizeof(m_Tuning)/sizeof(int); i++)
|
||||
Msg.AddInt(pParams[i]);
|
||||
Server()->SendMsg(&Msg, MSGFLAG_VITAL, Cid);
|
||||
Server()->SendMsg(&Msg, MSGFLAG_VITAL, ClientID);
|
||||
}
|
||||
|
||||
void CGameContext::OnTick()
|
||||
|
@ -598,31 +598,31 @@ void CGameContext::OnClientPredictedInput(int ClientID, void *pInput)
|
|||
m_apPlayers[ClientID]->OnPredictedInput((CNetObj_PlayerInput *)pInput);
|
||||
}
|
||||
|
||||
void CGameContext::OnClientEnter(int ClientId)
|
||||
void CGameContext::OnClientEnter(int ClientID)
|
||||
{
|
||||
//world.insert_entity(&players[client_id]);
|
||||
m_apPlayers[ClientId]->Respawn();
|
||||
m_apPlayers[ClientID]->Respawn();
|
||||
// init the player
|
||||
Score()->PlayerData(ClientId)->Reset();
|
||||
Score()->LoadScore(ClientId);
|
||||
Score()->PlayerData(ClientId)->m_CurrentTime = Score()->PlayerData(ClientId)->m_BestTime;
|
||||
m_apPlayers[ClientId]->m_Score = (Score()->PlayerData(ClientId)->m_BestTime)?Score()->PlayerData(ClientId)->m_BestTime:-9999;
|
||||
Score()->PlayerData(ClientID)->Reset();
|
||||
Score()->LoadScore(ClientID);
|
||||
Score()->PlayerData(ClientID)->m_CurrentTime = Score()->PlayerData(ClientID)->m_BestTime;
|
||||
m_apPlayers[ClientID]->m_Score = (Score()->PlayerData(ClientID)->m_BestTime)?Score()->PlayerData(ClientID)->m_BestTime:-9999;
|
||||
|
||||
if(((CServer *) Server())->m_aPrevStates[ClientId] < CServer::CClient::STATE_INGAME)
|
||||
if(((CServer *) Server())->m_aPrevStates[ClientID] < CServer::CClient::STATE_INGAME)
|
||||
{
|
||||
char aBuf[512];
|
||||
str_format(aBuf, sizeof(aBuf), "'%s' entered and joined the %s", Server()->ClientName(ClientId), m_pController->GetTeamName(m_apPlayers[ClientId]->GetTeam()));
|
||||
str_format(aBuf, sizeof(aBuf), "'%s' entered and joined the %s", Server()->ClientName(ClientID), m_pController->GetTeamName(m_apPlayers[ClientID]->GetTeam()));
|
||||
SendChat(-1, CGameContext::CHAT_ALL, aBuf);
|
||||
|
||||
SendChatTarget(ClientId, "DDRace Mod. Version: " GAME_VERSION);
|
||||
SendChatTarget(ClientId, "Official site: DDRace.info");
|
||||
SendChatTarget(ClientId, "For more Info /cmdlist");
|
||||
SendChatTarget(ClientId, "Or visit DDRace.info");
|
||||
SendChatTarget(ClientId, "To see this again say /info");
|
||||
SendChatTarget(ClientId, "Note This is an Alpha release, just for testing, your feedback is important!!");
|
||||
SendChatTarget(ClientID, "DDRace Mod. Version: " GAME_VERSION);
|
||||
SendChatTarget(ClientID, "Official site: DDRace.info");
|
||||
SendChatTarget(ClientID, "For more Info /cmdlist");
|
||||
SendChatTarget(ClientID, "Or visit DDRace.info");
|
||||
SendChatTarget(ClientID, "To see this again say /info");
|
||||
SendChatTarget(ClientID, "Note This is an Alpha release, just for testing, your feedback is important!!");
|
||||
|
||||
if(g_Config.m_SvWelcome[0]!=0) SendChatTarget(ClientId,g_Config.m_SvWelcome);
|
||||
//str_format(aBuf, sizeof(aBuf), "team_join player='%d:%s' team=%d", ClientId, Server()->ClientName(ClientId), m_apPlayers[ClientId]->GetTeam());
|
||||
if(g_Config.m_SvWelcome[0]!=0) SendChatTarget(ClientID,g_Config.m_SvWelcome);
|
||||
//str_format(aBuf, sizeof(aBuf), "team_join player='%d:%s' team=%d", ClientID, Server()->ClientName(ClientID), m_apPlayers[ClientID]->GetTeam());
|
||||
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "game", aBuf);
|
||||
}
|
||||
|
@ -630,12 +630,12 @@ void CGameContext::OnClientEnter(int ClientId)
|
|||
m_VoteUpdate = true;
|
||||
}
|
||||
|
||||
void CGameContext::OnClientConnected(int ClientId)
|
||||
void CGameContext::OnClientConnected(int ClientID)
|
||||
{
|
||||
// Check which team the player should be on
|
||||
const int StartTeam = g_Config.m_SvTournamentMode ? TEAM_SPECTATORS : m_pController->GetAutoTeam(ClientId);
|
||||
const int StartTeam = g_Config.m_SvTournamentMode ? TEAM_SPECTATORS : m_pController->GetAutoTeam(ClientID);
|
||||
|
||||
m_apPlayers[ClientId] = new(ClientId) CPlayer(this, ClientId, StartTeam);
|
||||
m_apPlayers[ClientID] = new(ClientID) CPlayer(this, ClientID, StartTeam);
|
||||
//players[client_id].init(client_id);
|
||||
//players[client_id].client_id = client_id;
|
||||
|
||||
|
@ -644,36 +644,36 @@ void CGameContext::OnClientConnected(int ClientId)
|
|||
#ifdef CONF_DEBUG
|
||||
if(g_Config.m_DbgDummies)
|
||||
{
|
||||
if(ClientId >= MAX_CLIENTS-g_Config.m_DbgDummies)
|
||||
if(ClientID >= MAX_CLIENTS-g_Config.m_DbgDummies)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// send active vote
|
||||
if(m_VoteCloseTime)
|
||||
SendVoteSet(ClientId);
|
||||
SendVoteSet(ClientID);
|
||||
|
||||
// send motd
|
||||
CNetMsg_Sv_Motd Msg;
|
||||
Msg.m_pMessage = g_Config.m_SvMotd;
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientId);
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientID);
|
||||
}
|
||||
|
||||
void CGameContext::OnClientDrop(int ClientId)
|
||||
void CGameContext::OnClientDrop(int ClientID)
|
||||
{
|
||||
AbortVoteKickOnDisconnect(ClientId);
|
||||
m_apPlayers[ClientId]->OnDisconnect();
|
||||
delete m_apPlayers[ClientId];
|
||||
m_apPlayers[ClientId] = 0;
|
||||
AbortVoteKickOnDisconnect(ClientID);
|
||||
m_apPlayers[ClientID]->OnDisconnect();
|
||||
delete m_apPlayers[ClientID];
|
||||
m_apPlayers[ClientID] = 0;
|
||||
|
||||
//(void)m_pController->CheckTeamBalance();
|
||||
m_VoteUpdate = true;
|
||||
}
|
||||
|
||||
void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
||||
void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientID)
|
||||
{
|
||||
void *pRawMsg = m_NetObjHandler.SecureUnpackMsg(MsgId, pUnpacker);
|
||||
CPlayer *p = m_apPlayers[ClientId];
|
||||
CPlayer *p = m_apPlayers[ClientID];
|
||||
|
||||
if(!pRawMsg)
|
||||
{
|
||||
|
@ -707,14 +707,14 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
|
||||
if(str_length(pMsg->m_pMessage)>370)
|
||||
{
|
||||
SendChatTarget(ClientId, "Your Message is too long");
|
||||
SendChatTarget(ClientID, "Your Message is too long");
|
||||
return;
|
||||
}
|
||||
|
||||
char aIP[16];
|
||||
int MuteTicks = 0;
|
||||
|
||||
Server()->GetClientIP(ClientId, aIP, sizeof aIP);
|
||||
Server()->GetClientIP(ClientID, aIP, sizeof aIP);
|
||||
|
||||
for(int z = 0; z < MAX_MUTES && MuteTicks <= 0; ++z) //find a mute, remove it, if expired.
|
||||
if (m_aMutes[z].m_IP[0] && str_comp(aIP, m_aMutes[z].m_IP) == 0 && (MuteTicks = m_aMutes[z].m_Expire - Server()->Tick()) <= 0)
|
||||
|
@ -724,15 +724,15 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
{
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof aBuf, "You are not permitted to talk for the next %d seconds.", MuteTicks / Server()->TickSpeed());
|
||||
SendChatTarget(ClientId, aBuf);
|
||||
SendChatTarget(ClientID, aBuf);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((p->m_ChatScore += g_Config.m_SvChatPenalty) > g_Config.m_SvChatThreshold)
|
||||
{
|
||||
char aIP[16];
|
||||
Server()->GetClientIP(ClientId, aIP, sizeof aIP);
|
||||
Mute(aIP, g_Config.m_SvSpamMuteDuration, Server()->ClientName(ClientId));
|
||||
Server()->GetClientIP(ClientID, aIP, sizeof aIP);
|
||||
Mute(aIP, g_Config.m_SvSpamMuteDuration, Server()->ClientName(ClientID));
|
||||
p->m_ChatScore = 0;
|
||||
return;
|
||||
}
|
||||
|
@ -749,12 +749,12 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
{
|
||||
ChatResponseInfo Info;
|
||||
Info.m_GameContext = this;
|
||||
Info.m_To = ClientId;
|
||||
Info.m_To = ClientID;
|
||||
|
||||
Console()->ExecuteLine(pMsg->m_pMessage + 1, ((CServer *) Server())->m_aClients[ClientId].m_Authed, ClientId, CServer::SendRconLineAuthed, Server(), SendChatResponse, &Info);
|
||||
Console()->ExecuteLine(pMsg->m_pMessage + 1, ((CServer *) Server())->m_aClients[ClientID].m_Authed, ClientID, CServer::SendRconLineAuthed, Server(), SendChatResponse, &Info);
|
||||
}
|
||||
else
|
||||
SendChat(ClientId, Team, pMsg->m_pMessage, ClientId);
|
||||
SendChat(ClientID, Team, pMsg->m_pMessage, ClientID);
|
||||
}
|
||||
else if(MsgId == NETMSGTYPE_CL_CALLVOTE)
|
||||
{
|
||||
|
@ -765,13 +765,13 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
p->m_Last_VoteTry = Now;
|
||||
if(g_Config.m_SvSpectatorVotes == 0 && p->GetTeam() == TEAM_SPECTATORS)
|
||||
{
|
||||
SendChatTarget(ClientId, "Spectators aren't allowed to start a vote.");
|
||||
SendChatTarget(ClientID, "Spectators aren't allowed to start a vote.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_VoteCloseTime)
|
||||
{
|
||||
SendChatTarget(ClientId, "Wait for current vote to end before calling a new one.");
|
||||
SendChatTarget(ClientID, "Wait for current vote to end before calling a new one.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -780,7 +780,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
{
|
||||
char aChatmsg[512] = {0};
|
||||
str_format(aChatmsg, sizeof(aChatmsg), "You must wait %d seconds before making another vote", (Timeleft/Server()->TickSpeed())+1);
|
||||
SendChatTarget(ClientId, aChatmsg);
|
||||
SendChatTarget(ClientID, aChatmsg);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -798,18 +798,18 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
{
|
||||
if(!Console()->LineIsValid(pOption->m_aCommand))
|
||||
{
|
||||
SendChatTarget(ClientId, "Invalid option");
|
||||
SendChatTarget(ClientID, "Invalid option");
|
||||
return;
|
||||
}
|
||||
if(m_apPlayers[ClientId]->m_Authed <= 0 && strncmp(pOption->m_aCommand, "sv_map ", 7) == 0 && time_get() < last_mapvote + (time_freq() * g_Config.m_SvVoteMapTimeDelay))
|
||||
if(m_apPlayers[ClientID]->m_Authed <= 0 && strncmp(pOption->m_aCommand, "sv_map ", 7) == 0 && time_get() < last_mapvote + (time_freq() * g_Config.m_SvVoteMapTimeDelay))
|
||||
{
|
||||
char chatmsg[512] = {0};
|
||||
str_format(chatmsg, sizeof(chatmsg), "There's a %d second delay between map-votes,Please wait %d Second(s)", g_Config.m_SvVoteMapTimeDelay,((last_mapvote+(g_Config.m_SvVoteMapTimeDelay * time_freq()))/time_freq())-(time_get()/time_freq()));
|
||||
SendChatTarget(ClientId, chatmsg);
|
||||
SendChatTarget(ClientID, chatmsg);
|
||||
|
||||
return;
|
||||
}
|
||||
str_format(aChatmsg, sizeof(aChatmsg), "'%s' called vote to change server option '%s'", Server()->ClientName(ClientId), pOption->m_aCommand);
|
||||
str_format(aChatmsg, sizeof(aChatmsg), "'%s' called vote to change server option '%s'", Server()->ClientName(ClientID), pOption->m_aCommand);
|
||||
str_format(aDesc, sizeof(aDesc), "%s", pOption->m_aCommand);
|
||||
str_format(aCmd, sizeof(aCmd), "%s", pOption->m_aCommand);
|
||||
last_mapvote = time_get();
|
||||
|
@ -824,12 +824,12 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
if (p->m_Authed < 3) // allow admins to call any vote they want
|
||||
{
|
||||
str_format(aChatmsg, sizeof(aChatmsg), "'%s' isn't an option on this server", pMsg->m_Value);
|
||||
SendChatTarget(ClientId, aChatmsg);
|
||||
SendChatTarget(ClientID, aChatmsg);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
str_format(aChatmsg, sizeof(aChatmsg), "'%s' called vote to change server option '%s'", Server()->ClientName(ClientId), pMsg->m_Value);
|
||||
str_format(aChatmsg, sizeof(aChatmsg), "'%s' called vote to change server option '%s'", Server()->ClientName(ClientID), pMsg->m_Value);
|
||||
str_format(aDesc, sizeof(aDesc), "%s", pMsg->m_Value);
|
||||
str_format(aCmd, sizeof(aCmd), "%s", pMsg->m_Value);
|
||||
}
|
||||
|
@ -840,51 +840,51 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
}
|
||||
else if(str_comp_nocase(pMsg->m_Type, "kick") == 0)
|
||||
{
|
||||
if(m_apPlayers[ClientId]->m_Authed == 0 && time_get() < m_apPlayers[ClientId]->m_Last_KickVote + (time_freq() * 5))
|
||||
if(m_apPlayers[ClientID]->m_Authed == 0 && time_get() < m_apPlayers[ClientID]->m_Last_KickVote + (time_freq() * 5))
|
||||
return;
|
||||
else if(m_apPlayers[ClientId]->m_Authed == 0 && time_get() < m_apPlayers[ClientId]->m_Last_KickVote + (time_freq() * g_Config.m_SvVoteKickTimeDelay))
|
||||
else if(m_apPlayers[ClientID]->m_Authed == 0 && time_get() < m_apPlayers[ClientID]->m_Last_KickVote + (time_freq() * g_Config.m_SvVoteKickTimeDelay))
|
||||
{
|
||||
char chatmsg[512] = {0};
|
||||
str_format(chatmsg, sizeof(chatmsg), "There's a %d second wait time between kick votes for each player please wait %d second(s)",
|
||||
g_Config.m_SvVoteKickTimeDelay,
|
||||
((m_apPlayers[ClientId]->m_Last_KickVote + (m_apPlayers[ClientId]->m_Last_KickVote*time_freq()))/time_freq())-(time_get()/time_freq())
|
||||
((m_apPlayers[ClientID]->m_Last_KickVote + (m_apPlayers[ClientID]->m_Last_KickVote*time_freq()))/time_freq())-(time_get()/time_freq())
|
||||
);
|
||||
SendChatTarget(ClientId, chatmsg);
|
||||
m_apPlayers[ClientId]->m_Last_KickVote = time_get();
|
||||
SendChatTarget(ClientID, chatmsg);
|
||||
m_apPlayers[ClientID]->m_Last_KickVote = time_get();
|
||||
return;
|
||||
}
|
||||
else if(!g_Config.m_SvVoteKick && p->m_Authed < 2) // allow admins to call kick votes even if they are forbidden
|
||||
{
|
||||
SendChatTarget(ClientId, "Server does not allow voting to kick players");
|
||||
m_apPlayers[ClientId]->m_Last_KickVote = time_get();
|
||||
SendChatTarget(ClientID, "Server does not allow voting to kick players");
|
||||
m_apPlayers[ClientID]->m_Last_KickVote = time_get();
|
||||
return;
|
||||
}
|
||||
|
||||
int KickId = str_toint(pMsg->m_Value);
|
||||
if(KickId < 0 || KickId >= MAX_CLIENTS || !m_apPlayers[KickId])
|
||||
{
|
||||
SendChatTarget(ClientId, "Invalid client id to kick");
|
||||
SendChatTarget(ClientID, "Invalid client id to kick");
|
||||
return;
|
||||
}
|
||||
if(KickId == ClientId)
|
||||
if(KickId == ClientID)
|
||||
{
|
||||
SendChatTarget(ClientId, "You cant kick yourself");
|
||||
SendChatTarget(ClientID, "You cant kick yourself");
|
||||
return;
|
||||
}
|
||||
if(ComparePlayers(m_apPlayers[KickId], p))
|
||||
{
|
||||
SendChatTarget(ClientId, "You cant kick admins");
|
||||
m_apPlayers[ClientId]->m_Last_KickVote = time_get();
|
||||
SendChatTarget(ClientID, "You cant kick admins");
|
||||
m_apPlayers[ClientID]->m_Last_KickVote = time_get();
|
||||
char aBufKick[128];
|
||||
str_format(aBufKick, sizeof(aBufKick), "'%s' called for vote to kick you", Server()->ClientName(ClientId));
|
||||
str_format(aBufKick, sizeof(aBufKick), "'%s' called for vote to kick you", Server()->ClientName(ClientID));
|
||||
SendChatTarget(KickId, aBufKick);
|
||||
return;
|
||||
}
|
||||
|
||||
if(GetPlayerChar(ClientId) && GetPlayerChar(KickId) && GetPlayerChar(ClientId)->Team() != GetPlayerChar(KickId)->Team())
|
||||
if(GetPlayerChar(ClientID) && GetPlayerChar(KickId) && GetPlayerChar(ClientID)->Team() != GetPlayerChar(KickId)->Team())
|
||||
{
|
||||
SendChatTarget(ClientId, "You can kick only your team member");
|
||||
m_apPlayers[ClientId]->m_Last_KickVote = time_get();
|
||||
SendChatTarget(ClientID, "You can kick only your team member");
|
||||
m_apPlayers[ClientID]->m_Last_KickVote = time_get();
|
||||
return;
|
||||
}
|
||||
const char *pReason = "No reason given";
|
||||
|
@ -897,7 +897,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
}
|
||||
}
|
||||
|
||||
str_format(aChatmsg, sizeof(aChatmsg), "'%s' called for vote to kick '%s' (%s)", Server()->ClientName(ClientId), Server()->ClientName(KickId), pReason);
|
||||
str_format(aChatmsg, sizeof(aChatmsg), "'%s' called for vote to kick '%s' (%s)", Server()->ClientName(ClientID), Server()->ClientName(KickId), pReason);
|
||||
str_format(aDesc, sizeof(aDesc), "Kick '%s'", Server()->ClientName(KickId));
|
||||
if (!g_Config.m_SvVoteKickBantime)
|
||||
str_format(aCmd, sizeof(aCmd), "kick %d Kicked by vote", KickId);
|
||||
|
@ -907,7 +907,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
Server()->GetClientIP(KickId, aBuf, sizeof(aBuf));
|
||||
str_format(aCmd, sizeof(aCmd), "ban %s %d Banned by vote", aBuf, g_Config.m_SvVoteKickBantime);
|
||||
}
|
||||
m_apPlayers[ClientId]->m_Last_KickVote = time_get();
|
||||
m_apPlayers[ClientID]->m_Last_KickVote = time_get();
|
||||
m_VoteKick = true;
|
||||
}
|
||||
|
||||
|
@ -917,7 +917,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
StartVote(aDesc, aCmd);
|
||||
p->m_Vote = 1;
|
||||
p->m_VotePos = m_VotePos = 1;
|
||||
m_VoteCreator = ClientId;
|
||||
m_VoteCreator = ClientID;
|
||||
p->m_Last_VoteCall = Now;
|
||||
}
|
||||
}
|
||||
|
@ -945,12 +945,12 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
return;
|
||||
|
||||
// Switch team on given client and kill/respawn him
|
||||
if(m_pController->CanJoinTeam(pMsg->m_Team, ClientId))
|
||||
if(m_pController->CanJoinTeam(pMsg->m_Team, ClientID))
|
||||
{
|
||||
//if(m_pController->CanChangeTeam(p, pMsg->m_Team))
|
||||
//{
|
||||
if(p->GetTeam()==-1 && p->m_InfoSaved)
|
||||
SendChatTarget(ClientId,"Use /pause first then you can kill");
|
||||
SendChatTarget(ClientID,"Use /pause first then you can kill");
|
||||
else
|
||||
{
|
||||
p->m_Last_SetTeam = Server()->Tick();
|
||||
|
@ -960,13 +960,13 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
//(void)m_pController->CheckTeamBalance();
|
||||
}
|
||||
//else
|
||||
//SendBroadcast("Teams must be balanced, please join other team", ClientId);
|
||||
//SendBroadcast("Teams must be balanced, please join other team", ClientID);
|
||||
}
|
||||
else
|
||||
{
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof(aBuf), "Only %d active players are allowed", g_Config.m_SvMaxClients-g_Config.m_SvSpectatorSlots);
|
||||
SendBroadcast(aBuf, ClientId);
|
||||
SendBroadcast(aBuf, ClientID);
|
||||
}
|
||||
}
|
||||
else if (MsgId == NETMSGTYPE_CL_ISDDRACE)
|
||||
|
@ -974,14 +974,14 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
p->m_IsUsingDDRaceClient = true;
|
||||
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof(aBuf), "%d use DDRace Client", ClientId);
|
||||
str_format(aBuf, sizeof(aBuf), "%d use DDRace Client", ClientID);
|
||||
dbg_msg("DDRace", aBuf);
|
||||
|
||||
//first update his teams state
|
||||
((CGameControllerDDRace*)m_pController)->m_Teams.SendTeamsState(ClientId);
|
||||
((CGameControllerDDRace*)m_pController)->m_Teams.SendTeamsState(ClientID);
|
||||
|
||||
//second give him records
|
||||
SendRecord(ClientId);
|
||||
SendRecord(ClientID);
|
||||
|
||||
|
||||
//third give him others current time for table score
|
||||
|
@ -992,18 +992,18 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
{
|
||||
CNetMsg_Sv_PlayerTime Msg;
|
||||
Msg.m_Time = Score()->PlayerData(i)->m_CurrentTime * 100;
|
||||
Msg.m_Cid = i;
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientId);
|
||||
Msg.m_ClientID = i;
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientID);
|
||||
//also send its time to others
|
||||
|
||||
}
|
||||
}
|
||||
//also send its time to others
|
||||
if(Score()->PlayerData(ClientId)->m_CurrentTime > 0) {
|
||||
if(Score()->PlayerData(ClientID)->m_CurrentTime > 0) {
|
||||
//TODO: make function for this fucking steps
|
||||
CNetMsg_Sv_PlayerTime Msg;
|
||||
Msg.m_Time = Score()->PlayerData(ClientId)->m_CurrentTime * 100;
|
||||
Msg.m_Cid = ClientId;
|
||||
Msg.m_Time = Score()->PlayerData(ClientID)->m_CurrentTime * 100;
|
||||
Msg.m_ClientID = ClientID;
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, -1);
|
||||
}
|
||||
}
|
||||
|
@ -1022,13 +1022,13 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
|
||||
// copy old name
|
||||
char aOldName[MAX_NAME_LENGTH];
|
||||
str_copy(aOldName, Server()->ClientName(ClientId), MAX_NAME_LENGTH);
|
||||
str_copy(aOldName, Server()->ClientName(ClientID), MAX_NAME_LENGTH);
|
||||
|
||||
Server()->SetClientName(ClientId, pMsg->m_pName);
|
||||
if(MsgId == NETMSGTYPE_CL_CHANGEINFO && str_comp(aOldName, Server()->ClientName(ClientId)) != 0)
|
||||
Server()->SetClientName(ClientID, pMsg->m_pName);
|
||||
if(MsgId == NETMSGTYPE_CL_CHANGEINFO && str_comp(aOldName, Server()->ClientName(ClientID)) != 0)
|
||||
{
|
||||
char aChatText[256];
|
||||
str_format(aChatText, sizeof(aChatText), "'%s' changed name to '%s'", aOldName, Server()->ClientName(ClientId));
|
||||
str_format(aChatText, sizeof(aChatText), "'%s' changed name to '%s'", aOldName, Server()->ClientName(ClientID));
|
||||
SendChat(-1, CGameContext::CHAT_ALL, aChatText);
|
||||
}
|
||||
|
||||
|
@ -1041,22 +1041,22 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
{
|
||||
// send vote options
|
||||
CNetMsg_Sv_VoteClearOptions ClearMsg;
|
||||
Server()->SendPackMsg(&ClearMsg, MSGFLAG_VITAL, ClientId);
|
||||
Server()->SendPackMsg(&ClearMsg, MSGFLAG_VITAL, ClientID);
|
||||
CVoteOption *pCurrent = m_pVoteOptionFirst;
|
||||
while(pCurrent)
|
||||
{
|
||||
CNetMsg_Sv_VoteOption OptionMsg;
|
||||
OptionMsg.m_pCommand = pCurrent->m_aCommand;
|
||||
Server()->SendPackMsg(&OptionMsg, MSGFLAG_VITAL, ClientId);
|
||||
Server()->SendPackMsg(&OptionMsg, MSGFLAG_VITAL, ClientID);
|
||||
pCurrent = pCurrent->m_pNext;
|
||||
}
|
||||
|
||||
// send tuning parameters to client
|
||||
SendTuningParams(ClientId);
|
||||
SendTuningParams(ClientID);
|
||||
|
||||
//
|
||||
CNetMsg_Sv_ReadyToEnter m;
|
||||
Server()->SendPackMsg(&m, MSGFLAG_VITAL|MSGFLAG_FLUSH, ClientId);
|
||||
Server()->SendPackMsg(&m, MSGFLAG_VITAL|MSGFLAG_FLUSH, ClientID);
|
||||
}
|
||||
}
|
||||
else if (MsgId == NETMSGTYPE_CL_EMOTICON && !m_World.m_Paused)
|
||||
|
@ -1068,7 +1068,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
|
||||
p->m_Last_Emote = Server()->Tick();
|
||||
|
||||
SendEmoticon(ClientId, pMsg->m_Emoticon);
|
||||
SendEmoticon(ClientID, pMsg->m_Emoticon);
|
||||
CCharacter* pChr = p->GetCharacter();
|
||||
if(pChr && g_Config.m_SvEmotionalTees && pChr->m_EyeEmote)
|
||||
{
|
||||
|
@ -1114,7 +1114,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
}
|
||||
}
|
||||
|
||||
void CGameContext::ConTuneParam(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
void CGameContext::ConTuneParam(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||
const char *pParamName = pResult->GetString(0);
|
||||
|
@ -1131,7 +1131,7 @@ void CGameContext::ConTuneParam(IConsole::IResult *pResult, void *pUserData, int
|
|||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "tuning", "No such tuning parameter");
|
||||
}
|
||||
|
||||
void CGameContext::ConTuneReset(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
void CGameContext::ConTuneReset(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||
CTuningParams p;
|
||||
|
@ -1140,7 +1140,7 @@ void CGameContext::ConTuneReset(IConsole::IResult *pResult, void *pUserData, int
|
|||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "tuning", "Tuning reset");
|
||||
}
|
||||
|
||||
void CGameContext::ConTuneDump(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
void CGameContext::ConTuneDump(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||
char aBuf[256];
|
||||
|
@ -1153,13 +1153,13 @@ void CGameContext::ConTuneDump(IConsole::IResult *pResult, void *pUserData, int
|
|||
}
|
||||
}
|
||||
|
||||
void CGameContext::ConChangeMap(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
void CGameContext::ConChangeMap(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||
pSelf->m_pController->ChangeMap(pResult->NumArguments() ? pResult->GetString(0) : "");
|
||||
}
|
||||
|
||||
void CGameContext::ConRestart(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
void CGameContext::ConRestart(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||
if(pResult->NumArguments())
|
||||
|
@ -1168,22 +1168,22 @@ void CGameContext::ConRestart(IConsole::IResult *pResult, void *pUserData, int C
|
|||
pSelf->m_pController->StartRound();
|
||||
}
|
||||
|
||||
void CGameContext::ConBroadcast(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
void CGameContext::ConBroadcast(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||
pSelf->SendBroadcast(pResult->GetString(0), -1);
|
||||
}
|
||||
|
||||
void CGameContext::ConSay(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
void CGameContext::ConSay(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||
pSelf->SendChat(-1, CGameContext::CHAT_ALL, pResult->GetString(0));
|
||||
}
|
||||
|
||||
void CGameContext::ConSetTeam(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
void CGameContext::ConSetTeam(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||
//int ClientId = clamp(pResult->GetInteger(0), 0, (int)MAX_CLIENTS-1);
|
||||
//int ClientID = clamp(pResult->GetInteger(0), 0, (int)MAX_CLIENTS-1);
|
||||
int Victim = pResult->GetVictim();
|
||||
int Team = clamp(pResult->GetInteger(0), -1, 1);
|
||||
|
||||
|
@ -1513,16 +1513,16 @@ void CGameContext::OnShutdown()
|
|||
Clear();
|
||||
}
|
||||
|
||||
void CGameContext::OnSnap(int ClientId)
|
||||
void CGameContext::OnSnap(int ClientID)
|
||||
{
|
||||
m_World.Snap(ClientId);
|
||||
m_pController->Snap(ClientId);
|
||||
m_Events.Snap(ClientId);
|
||||
m_World.Snap(ClientID);
|
||||
m_pController->Snap(ClientID);
|
||||
m_Events.Snap(ClientID);
|
||||
|
||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
if(m_apPlayers[i])
|
||||
m_apPlayers[i]->Snap(ClientId);
|
||||
m_apPlayers[i]->Snap(ClientID);
|
||||
}
|
||||
}
|
||||
void CGameContext::OnPreSnap() {}
|
||||
|
@ -1600,13 +1600,13 @@ bool CGameContext::PlayerHooking()
|
|||
return Temp != 0.0;
|
||||
}
|
||||
|
||||
void CGameContext::OnSetAuthed(int client_id, int Level)
|
||||
void CGameContext::OnSetAuthed(int ClientID, int Level)
|
||||
{
|
||||
if(m_apPlayers[client_id])
|
||||
if(m_apPlayers[ClientID])
|
||||
{
|
||||
m_apPlayers[client_id]->m_Authed = Level;
|
||||
m_apPlayers[ClientID]->m_Authed = Level;
|
||||
char buf[11];
|
||||
str_format(buf, sizeof(buf), "ban %d %d", client_id, g_Config.m_SvVoteKickBantime);
|
||||
str_format(buf, sizeof(buf), "ban %d %d", ClientID, g_Config.m_SvVoteKickBantime);
|
||||
if( !strcmp(m_aVoteCommand,buf))
|
||||
{
|
||||
m_VoteEnforce = CGameContext::VOTE_ENFORCE_NO;
|
||||
|
@ -1615,9 +1615,9 @@ void CGameContext::OnSetAuthed(int client_id, int Level)
|
|||
}
|
||||
}
|
||||
|
||||
void CGameContext::SendRecord(int ClientId) {
|
||||
void CGameContext::SendRecord(int ClientID) {
|
||||
CNetMsg_Sv_Record RecordsMsg;
|
||||
RecordsMsg.m_PlayerTimeBest = Score()->PlayerData(ClientId)->m_BestTime * 100.0f;//
|
||||
RecordsMsg.m_PlayerTimeBest = Score()->PlayerData(ClientID)->m_BestTime * 100.0f;//
|
||||
RecordsMsg.m_ServerTimeBest = m_pController->m_CurrentRecord * 100.0f;//TODO: finish this
|
||||
Server()->SendPackMsg(&RecordsMsg, MSGFLAG_VITAL, ClientId);
|
||||
Server()->SendPackMsg(&RecordsMsg, MSGFLAG_VITAL, ClientID);
|
||||
}
|
||||
|
|
|
@ -47,18 +47,18 @@ class CGameContext : public IGameServer
|
|||
CNetObjHandler m_NetObjHandler;
|
||||
CTuningParams m_Tuning;
|
||||
|
||||
static void ConTuneParam(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConTuneReset(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConTuneDump(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConChangeMap(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConRestart(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConBroadcast(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConSay(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConSetTeam(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConSetTeamAll(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConAddVote(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConClearVotes(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConVote(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConTuneParam(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConTuneReset(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConTuneDump(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConChangeMap(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConRestart(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConBroadcast(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConSay(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConSetTeam(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConSetTeamAll(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConAddVote(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConClearVotes(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConVote(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConchainSpecialMotdupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
||||
|
||||
CGameContext(int Resetting);
|
||||
|
@ -84,14 +84,14 @@ public:
|
|||
CGameWorld m_World;
|
||||
|
||||
// helper functions
|
||||
class CCharacter *GetPlayerChar(int ClientId);
|
||||
class CCharacter *GetPlayerChar(int ClientID);
|
||||
|
||||
// voting
|
||||
void StartVote(const char *pDesc, const char *pCommand);
|
||||
void EndVote();
|
||||
void SendVoteSet(int ClientId);
|
||||
void SendVoteStatus(int ClientId, int Total, int Yes, int No);
|
||||
void AbortVoteKickOnDisconnect(int ClientId);
|
||||
void SendVoteSet(int ClientID);
|
||||
void SendVoteStatus(int ClientID, int Total, int Yes, int No);
|
||||
void AbortVoteKickOnDisconnect(int ClientID);
|
||||
|
||||
int m_VoteCreator;
|
||||
int64 m_VoteCloseTime;
|
||||
|
@ -137,15 +137,15 @@ public:
|
|||
|
||||
// network
|
||||
void SendChatTarget(int To, const char *pText);
|
||||
void SendChat(int ClientId, int Team, const char *pText, int SpamProtectionClientId = -1);
|
||||
void SendEmoticon(int ClientId, int Emoticon);
|
||||
void SendWeaponPickup(int ClientId, int Weapon);
|
||||
void SendBroadcast(const char *pText, int ClientId);
|
||||
void SendChat(int ClientID, int Team, const char *pText, int SpamProtectionClientID = -1);
|
||||
void SendEmoticon(int ClientID, int Emoticon);
|
||||
void SendWeaponPickup(int ClientID, int Weapon);
|
||||
void SendBroadcast(const char *pText, int ClientID);
|
||||
|
||||
|
||||
//
|
||||
void CheckPureTuning();
|
||||
void SendTuningParams(int ClientId);
|
||||
void SendTuningParams(int ClientID);
|
||||
|
||||
// engine events
|
||||
virtual void OnInit();
|
||||
|
@ -154,16 +154,16 @@ public:
|
|||
|
||||
virtual void OnTick();
|
||||
virtual void OnPreSnap();
|
||||
virtual void OnSnap(int ClientId);
|
||||
virtual void OnSnap(int ClientID);
|
||||
virtual void OnPostSnap();
|
||||
|
||||
virtual void OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId);
|
||||
virtual void OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientID);
|
||||
|
||||
virtual void OnClientConnected(int ClientId);
|
||||
virtual void OnClientEnter(int ClientId);
|
||||
virtual void OnClientDrop(int ClientId);
|
||||
virtual void OnClientDirectInput(int ClientId, void *pInput);
|
||||
virtual void OnClientPredictedInput(int ClientId, void *pInput);
|
||||
virtual void OnClientConnected(int ClientID);
|
||||
virtual void OnClientEnter(int ClientID);
|
||||
virtual void OnClientDrop(int ClientID);
|
||||
virtual void OnClientDirectInput(int ClientID, void *pInput);
|
||||
virtual void OnClientPredictedInput(int ClientID, void *pInput);
|
||||
|
||||
virtual const char *Version();
|
||||
virtual const char *NetVersion();
|
||||
|
@ -175,75 +175,75 @@ private:
|
|||
|
||||
//DDRace Console Commands
|
||||
|
||||
//static void ConMute(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
//static void ConUnmute(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConLogOut(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConSetlvl1(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConSetlvl2(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConSetlvl3(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConKillPlayer(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
//static void ConMute(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
//static void ConUnmute(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConLogOut(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConSetlvl1(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConSetlvl2(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConSetlvl3(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConKillPlayer(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
|
||||
static void ConNinja(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConHammer(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConUnSuper(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConSuper(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConShotgun(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConGrenade(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConRifle(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConWeapons(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConUnShotgun(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConUnGrenade(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConUnRifle(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConUnWeapons(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConAddWeapon(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConRemoveWeapon(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConNinja(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConHammer(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConUnSuper(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConSuper(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConShotgun(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConGrenade(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConRifle(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConWeapons(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConUnShotgun(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConUnGrenade(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConUnRifle(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConUnWeapons(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConAddWeapon(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConRemoveWeapon(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
|
||||
void ModifyWeapons(int ClientId, int Victim, int Weapon, bool Remove);
|
||||
void MoveCharacter(int ClientId, int Victim, int X, int Y, bool Raw = false);
|
||||
void ModifyWeapons(int ClientID, int Victim, int Weapon, bool Remove);
|
||||
void MoveCharacter(int ClientID, int Victim, int X, int Y, bool Raw = false);
|
||||
|
||||
static void ConTeleport(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConPhook(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConTeleport(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConPhook(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
|
||||
static void ConFreeze(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConUnFreeze(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConTimerStop(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConTimerStart(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConTimerReStart(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConTimerZero(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConGoLeft(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConGoRight(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConGoUp(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConGoDown(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConFreeze(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConUnFreeze(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConTimerStop(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConTimerStart(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConTimerReStart(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConTimerZero(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConGoLeft(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConGoRight(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConGoUp(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConGoDown(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
|
||||
static void ConMove(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConMoveRaw(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConInvisMe(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConVisMe(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConInvis(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConVis(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConMove(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConMoveRaw(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConInvisMe(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConVisMe(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConInvis(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConVis(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
|
||||
static void ConCredits(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConInfo(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConHelp(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConSettings(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConRules(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConKill(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConTogglePause(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConTop5(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConRank(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConBroadTime(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConJoinTeam(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConToggleFly(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConMe(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConToggleEyeEmote(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConToggleBroadcast(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConEyeEmote(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConShowOthers(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConCredits(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConInfo(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConHelp(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConSettings(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConRules(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConKill(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConTogglePause(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConTop5(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConRank(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConBroadTime(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConJoinTeam(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConToggleFly(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConMe(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConToggleEyeEmote(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConToggleBroadcast(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConEyeEmote(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConShowOthers(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
|
||||
static void ConAsk(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConYes(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConNo(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConInvite(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConAsk(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConYes(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConNo(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConInvite(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConMute(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConMuteID(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConMuteIP(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
|
@ -261,7 +261,7 @@ public:
|
|||
VOTE_ENFORCE_NO_ADMIN = VOTE_ENFORCE_YES + 1,
|
||||
VOTE_ENFORCE_YES_ADMIN
|
||||
};
|
||||
void SendRecord(int ClientId);
|
||||
void SendRecord(int ClientID);
|
||||
static void SendChatResponse(const char *pLine, void *pUser);
|
||||
static void SendChatResponseAll(const char *pLine, void *pUser);
|
||||
struct ChatResponseInfo
|
||||
|
@ -269,7 +269,7 @@ public:
|
|||
CGameContext *m_GameContext;
|
||||
int m_To;
|
||||
};
|
||||
virtual void OnSetAuthed(int ClientId,int Level);
|
||||
virtual void OnSetAuthed(int ClientID,int Level);
|
||||
virtual bool PlayerCollision();
|
||||
virtual bool PlayerHooking();
|
||||
};
|
||||
|
@ -281,7 +281,7 @@ struct CMute {
|
|||
bool ComparePlayers(CPlayer *pl1, CPlayer *pl2);
|
||||
|
||||
inline int CmaskAll() { return -1; }
|
||||
inline int CmaskOne(int ClientId) { return 1<<ClientId; }
|
||||
inline int CmaskAllExceptOne(int ClientId) { return 0x7fffffff^CmaskOne(ClientId); }
|
||||
inline bool CmaskIsSet(int Mask, int ClientId) { return (Mask&CmaskOne(ClientId)) != 0; }
|
||||
inline int CmaskOne(int ClientID) { return 1<<ClientID; }
|
||||
inline int CmaskAllExceptOne(int ClientID) { return 0x7fffffff^CmaskOne(ClientID); }
|
||||
inline bool CmaskIsSet(int Mask, int ClientID) { return (Mask&CmaskOne(ClientID)) != 0; }
|
||||
#endif
|
||||
|
|
|
@ -537,17 +537,17 @@ void IGameController::DoWarmup(int Seconds)
|
|||
m_Warmup = Seconds*Server()->TickSpeed();
|
||||
}
|
||||
/*
|
||||
bool IGameController::IsFriendlyFire(int Cid1, int Cid2)
|
||||
bool IGameController::IsFriendlyFire(int ClientID1, int ClientID2)
|
||||
{
|
||||
if(Cid1 == Cid2)
|
||||
if(ClientID1 == ClientID2)
|
||||
return false;
|
||||
|
||||
if(IsTeamplay())
|
||||
{
|
||||
if(!GameServer()->m_apPlayers[Cid1] || !GameServer()->m_apPlayers[Cid2])
|
||||
if(!GameServer()->m_apPlayers[ClientID1] || !GameServer()->m_apPlayers[ClientID2])
|
||||
return false;
|
||||
|
||||
if(GameServer()->m_apPlayers[Cid1]->GetTeam() == GameServer()->m_apPlayers[Cid2]->GetTeam())
|
||||
if(GameServer()->m_apPlayers[ClientID1]->GetTeam() == GameServer()->m_apPlayers[ClientID2]->GetTeam())
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -565,7 +565,7 @@ bool IGameController::IsForceBalanced()
|
|||
return false;
|
||||
}
|
||||
|
||||
bool IGameController::CanBeMovedOnBalance(int Cid)
|
||||
bool IGameController::CanBeMovedOnBalance(int ClientID)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -78,14 +78,14 @@ public:
|
|||
void EndRound();
|
||||
void ChangeMap(const char *pToMap);
|
||||
|
||||
bool IsFriendlyFire(int Cid1, int Cid2);
|
||||
bool IsFriendlyFire(int ClientID1, int ClientID2);
|
||||
|
||||
bool IsForceBalanced();
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
virtual bool CanBeMovedOnBalance(int Cid);
|
||||
virtual bool CanBeMovedOnBalance(int ClientID);
|
||||
|
||||
virtual void Tick();
|
||||
|
||||
|
|
|
@ -64,9 +64,9 @@ int CGameControllerCTF::OnCharacterDeath(class CCharacter *pVictim, class CPlaye
|
|||
return HadFlag;
|
||||
}
|
||||
|
||||
bool CGameControllerCTF::CanBeMovedOnBalance(int Cid)
|
||||
bool CGameControllerCTF::CanBeMovedOnBalance(int ClientID)
|
||||
{
|
||||
CCharacter* Character = GameServer()->m_apPlayers[Cid]->GetCharacter();
|
||||
CCharacter* Character = GameServer()->m_apPlayers[ClientID]->GetCharacter();
|
||||
if(Character)
|
||||
{
|
||||
for(int fi = 0; fi < 2; fi++)
|
||||
|
|
|
@ -12,7 +12,7 @@ public:
|
|||
class CFlag *m_apFlags[2];
|
||||
|
||||
CGameControllerCTF(class CGameContext *pGameServer);
|
||||
virtual bool CanBeMovedOnBalance(int Cid);
|
||||
virtual bool CanBeMovedOnBalance(int ClientID);
|
||||
virtual void Tick();
|
||||
|
||||
virtual bool OnEntity(int Index, vec2 Pos);
|
||||
|
@ -21,4 +21,4 @@ public:
|
|||
|
||||
#endif
|
||||
|
||||
*/
|
||||
*/
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue