Client class and Server class communication

Grab your favourite IDE and tinker with the innards of game engines

Client class and Server class communication

Postby Sapphon on Thu Nov 18, 2010 1:27 am

Hey folks,

For my SP mod I have designed and tested (as much as is currently possible) a class for an additional VGUI panel to display the player's inventory (CInventoryPanel), and a class (CPlayerInventory) to hold data about the player's inventory, along with some helper classes for each.

My problem now is that I have no experience with multi-project solutions, and I am not sure how to get a class that is necessarily part of client.dll (where VGUI stuff goes) to be able to call member functions of a class that is necessarily part of server.dll (where player and entity info goes). If the player can have an inventory but not see it, or see it but not have it, it's not much use =P

If this is impossible and the panel cannot directly access member functions of the player's inventory, then perhaps networked variables are the solution. In that case I'd appreciate any pointers towards a good tutorial on those, as I understand them lots in concept but little in practice.

Another way to help me would be to point out a currently-extant pair of classes in the Source SDK that do cross-dll communication that doesn't happen every frame (ideally the inventory class would only act when the inventory panel asked it to); I could examine that relationship for hints on how to establish my own.

Any help appreciated!
Sapphon
Dumpling
Dumpling
 
Joined: Mon Oct 04, 2010 3:57 pm

Re: Client class and Server class communication

Postby omnicoder on Thu Nov 18, 2010 1:37 am

Valve usually makes a _shared file for things both need and just include it in both, eg. foobar_shared.cpp etc.
Image
If only the future implemented IForeseeable...
"whats threading? does it have to do with strings?" - stegarootbeer
User avatar
omnicoder
Been Here A While
Been Here A While
 
Joined: Sun Feb 07, 2010 8:35 am

Re: Client class and Server class communication

Postby zombie@computer on Thu Nov 18, 2010 10:12 am

When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Return to Programming

Who is online

Users browsing this forum: No registered users