Advertisement
Guest User

EOPlugins C++ Example

a guest
Aug 26th, 2014
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.29 KB | None | 0 0
  1. #include "main.h"
  2. #include <stdio.h>
  3. #include <string>
  4.  
  5. struct gameclient
  6. {
  7.     bool proxyenabled; // true if embedded proxy is enabled, false if otherwise or error
  8.     int pid;
  9.     int windowX;
  10.     int windowY;
  11.     int windowWidth;
  12.     int windowHeight;
  13.     int windowhwnd;
  14.     int gameserverPort; //port used by game client. 0 if proxyenabled == false
  15.     std::string gameserverIp; //port used by game client. "" if proxyenabled == false
  16.     std::string windowTitle;
  17. };
  18.  
  19.  
  20. void DLL_EXPORT __stdcall pluginload(gameclient *gamedata)
  21. {
  22.     if (gamedata->proxyenabled == true)
  23.     {
  24.          MessageBoxA(0,"YAY PROXY IS ENABLED","Test Plugin",MB_OK);
  25.     }
  26.     MessageBoxA(0,"Example plugin load","Test Plugin",MB_OK);
  27. }
  28.  
  29. void DLL_EXPORT __stdcall pluginunload(gameclient *gamedata)
  30. {
  31.    MessageBoxA(0,"Example plugin unload","Test Plugin",MB_OK);
  32. }
  33.  
  34. void DLL_EXPORT __stdcall pluginrun(gameclient *gamedata)
  35. {
  36.     MessageBoxA(0,"Example plugin run","Test Plugin",MB_OK);
  37. }
  38.  
  39. bool DLL_EXPORT __stdcall pluginsendpacket(gameclient *gamedata, int Packet_length, char *buffer)
  40. {
  41.     return false; //return true to cancel packet
  42. }
  43.  
  44. bool DLL_EXPORT __stdcall pluginrecvpacket(gameclient *gamedata, int Packet_length, char *buffer)
  45. {
  46.     return false; //return true to cancel packet
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement