Changeset 881


Ignore:
Timestamp:
Jun 3, 2013, 7:01:38 PM (12 years ago)
Author:
alloc
Message:

Daodan: Some flatline cleanups

Location:
Daodan/src/flatline
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • Daodan/src/flatline/Flatline.c

    r879 r881  
    1414#define isnan(x) ((x) != (x))
    1515
    16 uint32_t last1 = 0; uint32_t last2 = 0;
    1716player_info Players[MAX_PLAYERS];
    1817player_info * PlayerList[MAX_CONNECTIONS] = {0};
     
    2827};
    2928
    30 #define BETTER_SYNC
    31 
    32 
     29typedef struct
     30{
     31        uint16_t x;
     32        uint16_t y;
     33} IMtPoint2D;
     34
     35extern uint16_t max_connections;
    3336
    3437
     
    7780}
    7881
    79 extern uint16_t max_connections;
    8082uint16_t FLr_FindEmptyListSlot() {
    8183        int j;
     
    8789        return -1;
    8890}
    89 typedef struct
    90 {
    91         uint16_t x;
    92         uint16_t y;
    93 } IMtPoint2D;
    94 static flatline_packet cache_input = {0};
    9591
    9692
    9793void * ONICALL FLrInput_Update_Keys(void)
    9894{
    99         uint32_t i;
     95        int32_t i;
    10096        flatline_packet all_input = {0};
    10197        int16_t InputIndex = 0;
  • Daodan/src/flatline/Flatline.h

    r877 r881  
    2222#include "../Oni_Character.h"
    2323#include "../Oni_GameState.h"
    24 #include "Flatline_Packet.h"
    2524
    2625#include "../Oni_Symbols.h"
     
    3231DWORD WINAPI StartServer(void* lol);
    3332DWORD WINAPI StartClient(void* lol);
     33
     34
     35typedef struct
     36{
     37        uint16_t ID;
     38        uint16_t Size;
     39        uint16_t UpdateFlags;
     40        uint8_t  data[255];
     41} PlayerData;
     42
     43
     44typedef struct {
     45        uint32_t Actions1;
     46        uint32_t Actions2;
     47        float MouseDeltaX;
     48        float MouseDeltaY;     
     49} PlayerInput;
     50
     51typedef struct {
     52        float Facing;
     53        float DesiredFacing;
     54} PlayerFacing;
     55
     56typedef struct {
     57        uint16_t Health;
     58        uint16_t MaxHealth;
     59} PlayerHealth;
     60
     61typedef struct {
     62        uint16_t Score;
     63        uint16_t Deaths;
     64} PlayerScore;
     65
     66//Change this later to be misc info
     67typedef struct {
     68        uint16_t Frame;
     69        uint16_t Ping;
     70} PlayerFP;
     71
     72typedef struct {
     73        uint8_t Ammo;
     74        uint8_t Cells;
     75        uint8_t Hypo;
     76        uint8_t pad;
     77        uint16_t Invis;
     78        uint16_t Shield;
     79} PlayerInventory;
     80
     81typedef struct {
     82        uint16_t                                throwing;
     83        uint16_t                                throwFrame;
     84        char                                    throwName[32];
     85} PlayerThrowData;
     86
     87enum
     88{
     89        PFlag_None,
     90        PFlag_Input,
     91        PFlag_Facing,   
     92        PFlag_Health,           
     93        PFlag_Score,            //TODO
     94        PFlag_FramePing,
     95        PFlag_Inventory, //TODO
     96        PFlag_Class,   
     97        PFlag_Position,
     98        PFlag_Animation,       
     99        PFlag_Throws,
     100        PFlag_Max,
     101        PFlag_AnimationWait,//Clients only!
     102};
    34103
    35104
  • Daodan/src/flatline/Flatline_Client.c

    r877 r881  
    11#include "Flatline.h"
    22#include "Flatline_Client.h"
     3#include "Flatline_Packet.h"
    34#include "Mariusnet_Public.h"
     5#include "../Daodan_Patch.h"
    46//#include "PortForwardWrapper.h"
    57
  • Daodan/src/flatline/Flatline_Packet.h

    r877 r881  
    22#define FLATLINE_PACKET_H
    33#include "stdint.h"
     4#include "Flatline.h"
    45
    56
    67uint16_t FLpData_PartSize( uint8_t e);
    78void FLsSendPlayerData();
    8 //void FLcReadPlayerData( flatline_packet* Packet, int16_t Size );
    9 
    10 typedef struct
    11 {
    12         uint16_t ID;
    13         uint16_t Size;
    14         uint16_t UpdateFlags;
    15         uint8_t  data[255];
    16 } PlayerData;
    17 
    18 
    19 typedef struct {
    20         uint32_t Actions1;
    21         uint32_t Actions2;
    22         float MouseDeltaX;
    23         float MouseDeltaY;     
    24 } PlayerInput;
    25 
    26 typedef struct {
    27         float Facing;
    28         float DesiredFacing;
    29 } PlayerFacing;
    30 
    31 typedef struct {
    32         uint16_t Health;
    33         uint16_t MaxHealth;
    34 } PlayerHealth;
    35 
    36 typedef struct {
    37         uint16_t Score;
    38         uint16_t Deaths;
    39 } PlayerScore;
    40 
    41 //Change this later to be misc info
    42 typedef struct {
    43         uint16_t Frame;
    44         uint16_t Ping;
    45 } PlayerFP;
    46 
    47 typedef struct {
    48         uint8_t Ammo;
    49         uint8_t Cells;
    50         uint8_t Hypo;
    51         uint8_t pad;
    52         uint16_t Invis;
    53         uint16_t Shield;
    54 } PlayerInventory;
    55 
    56 typedef struct {
    57         uint16_t                                throwing;
    58         uint16_t                                throwFrame;
    59         char                                    throwName[32];
    60 } PlayerThrowData;
    61 
    62 enum
    63 {
    64         PFlag_None,
    65         PFlag_Input,
    66         PFlag_Facing,   
    67         PFlag_Health,           
    68         PFlag_Score,            //TODO
    69         PFlag_FramePing,
    70         PFlag_Inventory, //TODO
    71         PFlag_Class,   
    72         PFlag_Position,
    73         PFlag_Animation,       
    74         PFlag_Throws,
    75         PFlag_Max,
    76         PFlag_AnimationWait,//Clients only!
    77 };
     9void FLcReadPlayerData( flatline_packet* Packet, int16_t Size );
    7810
    7911
  • Daodan/src/flatline/Flatline_PacketBuilder.c

    r877 r881  
    22#include "../Oni_Symbols.h"
    33#include <assert.h>
     4#include "Flatline_Packet.h"
    45
    56#define FLAG_AND_INCREMENT( FLAG )      PD->UpdateFlags |= (1 << FLAG ); DataPointer += FLpData_PartSize( FLAG );
  • Daodan/src/flatline/Flatline_PacketReader.c

    r877 r881  
    11#include "Flatline.h"
     2#include "Flatline_Packet.h"
    23
    34bool DoWeUpdateThis( uint16_t BitSet, uint16_t Flag )
  • Daodan/src/flatline/Mariusnet.c

    r877 r881  
    99#include "../Oni_Symbols.h"
    1010#include <stdio.h>
    11 
    12 #pragma comment(lib, "wininet.lib")
    13 
    1411
    1512char MariusLogin[32]={0};
  • Daodan/src/flatline/Mariusnet_Public.h

    r877 r881  
     1#ifndef MARIUSNET_PUBLIC_H
     2#define MARIUSNET_PUBLIC_H
     3
    14extern unsigned char MsNet_Running;
    25
     
    4043} m_announcegame;
    4144
     45int MSNet_CreateGame( m_announcegame* Game );
     46
     47#endif
Note: See TracChangeset for help on using the changeset viewer.