Changes between Initial Version and Version 1 of ServerProgrammingDealingWithIO


Ignore:
Timestamp:
Aug 26, 2011 4:24:37 PM (13 years ago)
Author:
jpawlick
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ServerProgrammingDealingWithIO

    v1 v1  
     1== Quake Filesystem ==
     2Quake uses a private, isolated filesystem for all file I/O. This means that all data generated directly from the game - screenshots, log files, etc., will be stored in this filesystem. The "home directory" for this filesystem, where all loads and stores occur by default, is located at ~/.quagents3/quagents3. The '.' prefix on the directory indicates a hidden directory, which means you will not be able to see it from your standard GUI filesystem browser. Instead, use your terminal to access it.
     3
     4For more information, see the "files.c" file located in code/qcommon.
     5
     6== Sockets ==
     7We have patched in our own sockets for Quagent use. They live outside any of the VMs (as the VM security (that is, lack of power) prevents you from doing this inside the VMs). There are various [[ServerProgrammingDealingWithVMs|trap functions]] that we have added for this purpose. The "end" of these trap functions live in qcommon/net_ip.c. The functions are
     8 * trap_Com_QuagentsReadStr : Reads from a socket into the memory provided.
     9 * trap_Com_QuagentsWriteStr : Writes the string to a socket (automatically sized).
     10 * trap_Com_QuagentsWriteBuff : Writes a number of bytes to a socket.
     11All of our sockets are non-blocking. The game periodically calls reads, and certain events or actions can precipitate writes. Reads are sourced in two places:
     12 * All active quagents call trap_Com_QuagentsReadStr as part of their AI_Frame in ai_main.c.
     13 * All initializing quagents and the director deal with reads in the BotAI_QuagentsDirectorRead function in ai_main.c. This function is called every game frame (by a VM_Call) whether or not the game is paused.