├── csgo ├── protobufs │ ├── __init__.py │ └── engine_gcmessages_pb2.py ├── enums.py ├── __init__.py ├── features │ ├── __init__.py │ ├── items.py │ ├── player.py │ ├── match.py │ └── sharedobjects.py ├── common_enums.py ├── sharecode.py ├── msg.py ├── client.py └── proto_enums.py ├── docs ├── .gitignore ├── csgo.client.rst ├── csgo.msg.rst ├── csgo.sharecode.rst ├── csgo.features.items.rst ├── csgo.features.match.rst ├── csgo.features.player.rst ├── csgo.features.sharedobjects.rst ├── csgo.rst ├── csgo.enums.rst ├── csgo.features.rst ├── index.rst ├── user_guide.rst ├── Makefile └── conf.py ├── .coveragerc ├── .gitignore ├── requirements.txt ├── protobufs ├── engine_gcmessages.proto ├── gcsystemmsgs.proto ├── econ_gcmessages.proto ├── gcsdk_gcmessages.proto ├── base_gcmessages.proto ├── steammessages.proto └── google │ └── protobuf │ └── descriptor.proto ├── protobuf_list.txt ├── setup.py ├── README.rst ├── Makefile └── gen_enum_from_protos.py /csgo/protobufs/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | _doc 2 | _build 3 | _static 4 | _templates 5 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | concurrency = gevent 3 | omit = 4 | dota2/protobufs/* 5 | -------------------------------------------------------------------------------- /csgo/enums.py: -------------------------------------------------------------------------------- 1 | 2 | from csgo.common_enums import * 3 | from csgo.proto_enums import * 4 | -------------------------------------------------------------------------------- /csgo/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = "1.0.0" 2 | __author__ = "Rossen Georgiev" 3 | 4 | version_info = (1, 0, 0) 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | *.egg-info 3 | *.pyc 4 | .coverage 5 | *.swp 6 | 7 | csgo/protobufs/*.proto 8 | credentials/* 9 | -------------------------------------------------------------------------------- /docs/csgo.client.rst: -------------------------------------------------------------------------------- 1 | client 2 | ====== 3 | 4 | .. automodule:: csgo.client 5 | :members: 6 | :show-inheritance: 7 | -------------------------------------------------------------------------------- /docs/csgo.msg.rst: -------------------------------------------------------------------------------- 1 | msg 2 | === 3 | 4 | .. automodule:: csgo.msg 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/csgo.sharecode.rst: -------------------------------------------------------------------------------- 1 | sharecode 2 | ========= 3 | 4 | .. automodule:: csgo.sharecode 5 | :members: 6 | :show-inheritance: 7 | -------------------------------------------------------------------------------- /docs/csgo.features.items.rst: -------------------------------------------------------------------------------- 1 | items 2 | ===== 3 | 4 | .. automodule:: csgo.features.items 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/csgo.features.match.rst: -------------------------------------------------------------------------------- 1 | match 2 | ===== 3 | 4 | .. automodule:: csgo.features.match 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | six==1.10 2 | enum34==1.1.2; python_version < '3.4' 3 | gevent>=1.3.0 4 | protobuf>=3.0.0 5 | steam[client]~=1.0 6 | gevent-eventemitter~=2.1 7 | -------------------------------------------------------------------------------- /docs/csgo.features.player.rst: -------------------------------------------------------------------------------- 1 | player 2 | ====== 3 | 4 | .. automodule:: csgo.features.player 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/csgo.features.sharedobjects.rst: -------------------------------------------------------------------------------- 1 | sharedobjects 2 | ============= 3 | 4 | .. automodule:: csgo.features.sharedobjects 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/csgo.rst: -------------------------------------------------------------------------------- 1 | csgo API 2 | ========= 3 | 4 | Documentation related to various APIs available in this package. 5 | 6 | .. toctree:: 7 | 8 | csgo.msg 9 | csgo.enums 10 | csgo.sharecode 11 | csgo.client 12 | csgo.features 13 | -------------------------------------------------------------------------------- /docs/csgo.enums.rst: -------------------------------------------------------------------------------- 1 | enums 2 | ===== 3 | 4 | .. automodule:: csgo.common_enums 5 | :members: 6 | :undoc-members: 7 | :inherited-members: 8 | 9 | .. automodule:: csgo.proto_enums 10 | :members: 11 | :undoc-members: 12 | :inherited-members: 13 | -------------------------------------------------------------------------------- /docs/csgo.features.rst: -------------------------------------------------------------------------------- 1 | features 2 | ======== 3 | 4 | This package contains all high level features of :class:`csgo.client.CSGOClient`. 5 | 6 | .. toctree:: 7 | 8 | csgo.features.match 9 | csgo.features.player 10 | csgo.features.items 11 | csgo.features.sharedobjects 12 | -------------------------------------------------------------------------------- /csgo/features/__init__.py: -------------------------------------------------------------------------------- 1 | from csgo.features.match import Match 2 | from csgo.features.player import Player 3 | from csgo.features.items import Items 4 | from csgo.features.sharedobjects import SOBase 5 | 6 | class FeatureBase(Match, Player, Items, SOBase): 7 | """ 8 | This object is used to all high level functionality to CSGOClient. 9 | The features are seperated into submodules with a single class. 10 | """ 11 | pass 12 | -------------------------------------------------------------------------------- /protobufs/engine_gcmessages.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package csgo; 3 | import "google/protobuf/descriptor.proto"; 4 | 5 | option py_generic_services = false; 6 | 7 | message CEngineGotvSyncPacket { 8 | optional uint64 match_id = 1; 9 | optional uint32 instance_id = 2; 10 | optional uint32 signupfragment = 3; 11 | optional uint32 currentfragment = 4; 12 | optional float tickrate = 5; 13 | optional uint32 tick = 6; 14 | optional float rtdelay = 8; 15 | optional float rcvage = 9; 16 | optional float keyframe_interval = 10; 17 | optional uint32 cdndelay = 11; 18 | } 19 | -------------------------------------------------------------------------------- /protobuf_list.txt: -------------------------------------------------------------------------------- 1 | https://raw.githubusercontent.com/SteamDatabase/GameTracking-CSGO/master/Protobufs/steammessages.proto 2 | https://raw.githubusercontent.com/SteamDatabase/GameTracking-CSGO/master/Protobufs/gcsystemmsgs.proto 3 | https://raw.githubusercontent.com/SteamDatabase/GameTracking-CSGO/master/Protobufs/base_gcmessages.proto 4 | https://raw.githubusercontent.com/SteamDatabase/GameTracking-CSGO/master/Protobufs/gcsdk_gcmessages.proto 5 | https://raw.githubusercontent.com/SteamDatabase/GameTracking-CSGO/master/Protobufs/engine_gcmessages.proto 6 | https://raw.githubusercontent.com/SteamDatabase/GameTracking-CSGO/master/Protobufs/cstrike15_gcmessages.proto 7 | https://raw.githubusercontent.com/SteamDatabase/GameTracking-CSGO/master/Protobufs/econ_gcmessages.proto 8 | 9 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to csgo's documentation! 2 | ================================= 3 | 4 | |pypi| |license| 5 | 6 | Supports Python ``2.7+`` and ``3.4+``. 7 | 8 | | Module based on `steam `_ for interacting with CSGO's Game Coordinator. 9 | 10 | As always contributions and suggestions are welcome. 11 | Just visit the `repository on github `_. 12 | 13 | User Guide 14 | ---------- 15 | 16 | .. toctree:: 17 | 18 | user_guide 19 | 20 | API Documentation 21 | ----------------- 22 | 23 | .. toctree:: 24 | :maxdepth: 4 25 | 26 | csgo 27 | 28 | 29 | Indices and tables 30 | ================== 31 | 32 | * :ref:`genindex` 33 | * :ref:`modindex` 34 | * :ref:`search` 35 | 36 | .. |pypi| image:: https://img.shields.io/pypi/v/csgo.svg?style=flat&label=latest%20version 37 | :target: https://pypi.python.org/pypi/csgo 38 | :alt: Latest version released on PyPi 39 | 40 | .. |license| image:: https://img.shields.io/pypi/l/csgo.svg?style=flat&label=license 41 | :target: https://pypi.python.org/pypi/csgo 42 | :alt: MIT License 43 | -------------------------------------------------------------------------------- /csgo/common_enums.py: -------------------------------------------------------------------------------- 1 | from enum import IntEnum 2 | 3 | class ESOType(IntEnum): 4 | CSOEconItem = 1 5 | CSOPersonaDataPublic = 2 6 | CSOItemRecipe = 5 7 | CSOEconGameAccountClient = 7 8 | CSOEconItemDropRateBonus = 38 9 | CSOEconItemEventTicket = 40 10 | CSOAccountSeasonalOperation = 41 11 | CSOEconDefaultEquippedDefinitionInstanceClient = 43 12 | CSOEconCoupon = 45 13 | CSOQuestProgress = 46 14 | 15 | 16 | class EXPBonusFlag(IntEnum): 17 | EarnedXpThisPeriod = 1 << 0 18 | FirstReward = 1 << 1 19 | Msg_YourReportGotConvicted = 1 << 2 20 | Msg_YouPartiedWithCheaters = 1 << 3 21 | PrestigeEarned = 1 << 4 22 | ChinaGovernmentCert = 1 << 5 23 | OverwatchBonus = 1 << 28 24 | BonusBoostConsumed = 1 << 29 25 | ReducedGain = 1 << 30 26 | 27 | 28 | # Do not remove 29 | from sys import modules 30 | from enum import EnumMeta 31 | 32 | __all__ = [obj.__name__ 33 | for obj in modules[__name__].__dict__.values() 34 | if obj.__class__ is EnumMeta and obj.__name__ != 'IntEnum' 35 | ] 36 | 37 | del modules, EnumMeta 38 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from setuptools import setup, find_packages 4 | from codecs import open 5 | from os import path 6 | import sys 7 | 8 | here = path.abspath(path.dirname(__file__)) 9 | with open(path.join(here, 'README.rst'), encoding='utf-8') as f: 10 | long_description = f.read() 11 | with open(path.join(here, 'csgo/__init__.py'), encoding='utf-8') as f: 12 | __version__ = f.readline().split('"')[1] 13 | 14 | install_requires = [ 15 | 'steam~=1.0', 16 | 'gevent-eventemitter>=2.1', 17 | 'gevent>=1.3.0', 18 | 'protobuf>=3.0.0', 19 | 'six>=1.10', 20 | ] 21 | 22 | if sys.version_info < (3, 4): 23 | install_requires.append('enum34>=1.0.4') 24 | 25 | setup( 26 | name='csgo', 27 | version=__version__, 28 | description='Module for interacting CSGO\'s Game Coordinator', 29 | long_description=long_description, 30 | url='https://github.com/ValvePython/csgo', 31 | author="Rossen Georgiev", 32 | author_email='rossen@rgp.io', 33 | license='MIT', 34 | classifiers=[ 35 | 'Development Status :: 4 - Beta', 36 | 'Intended Audience :: Developers', 37 | 'License :: OSI Approved :: MIT License', 38 | 'Topic :: Software Development :: Libraries :: Python Modules', 39 | 'Natural Language :: English', 40 | 'Operating System :: OS Independent', 41 | 'Programming Language :: Python :: 2.7', 42 | 'Programming Language :: Python :: 3.4', 43 | 'Programming Language :: Python :: 3.5', 44 | 'Programming Language :: Python :: 3.6', 45 | 'Programming Language :: Python :: 3.7', 46 | 'Programming Language :: Python :: 3.8', 47 | ], 48 | keywords='valve steam steamid api webapi csgo global offensive', 49 | packages=['csgo'] + ['csgo.'+x for x in find_packages(where='csgo')], 50 | install_requires=install_requires, 51 | zip_safe=True, 52 | ) 53 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | | |pypi| |license| |docs| 2 | | |sonar_maintainability| |sonar_reliability| |sonar_security| 3 | 4 | Supports Python ``2.7+`` and ``3.3+``. 5 | 6 | Module based on `steam `_ 7 | for interacting with CSGO's Game Coordinator. 8 | 9 | **Documentation**: http://csgo.readthedocs.io 10 | 11 | | Note that this module should be considered an alpha. 12 | | Contributions and suggestion are always welcome. 13 | 14 | 15 | Installation 16 | ------------ 17 | 18 | Install latest version from PYPI:: 19 | 20 | pip install -U csgo 21 | 22 | Install the current dev version from ``github``:: 23 | 24 | pip install git+https://github.com/ValvePython/csgo 25 | 26 | 27 | .. |pypi| image:: https://img.shields.io/pypi/v/csgo.svg?style=flat&label=latest%20version 28 | :target: https://pypi.python.org/pypi/csgo 29 | :alt: Latest version released on PyPi 30 | 31 | .. |license| image:: https://img.shields.io/pypi/l/csgo.svg?style=flat&label=license 32 | :target: https://pypi.python.org/pypi/csgo 33 | :alt: MIT License 34 | 35 | .. |docs| image:: https://readthedocs.org/projects/csgo/badge/?version=latest 36 | :target: http://csgo.readthedocs.io/en/latest/?badge=latest 37 | :alt: Documentation status 38 | 39 | .. |sonar_maintainability| image:: https://sonarcloud.io/api/project_badges/measure?project=ValvePython_csgo&metric=sqale_rating 40 | :target: https://sonarcloud.io/dashboard?id=ValvePython_csgo 41 | :alt: SonarCloud Rating 42 | 43 | .. |sonar_reliability| image:: https://sonarcloud.io/api/project_badges/measure?project=ValvePython_csgo&metric=reliability_rating 44 | :target: https://sonarcloud.io/dashboard?id=ValvePython_csgo 45 | :alt: SonarCloud Rating 46 | 47 | .. |sonar_security| image:: https://sonarcloud.io/api/project_badges/measure?project=ValvePython_csgo&metric=security_rating 48 | :target: https://sonarcloud.io/dashboard?id=ValvePython_csgo 49 | :alt: SonarCloud Rating 50 | -------------------------------------------------------------------------------- /csgo/sharecode.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | dictionary = "ABCDEFGHJKLMNOPQRSTUVWXYZabcdefhijkmnopqrstuvwxyz23456789" 4 | 5 | _bitmask64 = 2**64 - 1 6 | 7 | def _swap_endianness(number): 8 | result = 0 9 | 10 | for n in range(0, 144, 8): 11 | result = (result << 8) + ((number >> n) & 0xFF) 12 | 13 | return result 14 | 15 | def decode(code): 16 | """Decodes a match share code 17 | 18 | :param code: match share code (e.g. ``CSGO-Ab1cD-xYz23-7bcD9-uVZ23-12aBc``) 19 | :type code: str 20 | :raises: :class:`ValueError` 21 | :return: dict with matchid, outcomeid and token 22 | :rtype: dict 23 | 24 | .. code:: python 25 | 26 | {'matchid': 0, 27 | 'outcomeid': 0, 28 | 'token': 0 29 | } 30 | """ 31 | if not re.match(r'^(CSGO)?(-?[%s]{5}){5}$' % dictionary, code): 32 | raise ValueError("Invalid share code") 33 | 34 | code = re.sub('CSGO\-|\-', '', code)[::-1] 35 | 36 | a = 0 37 | for c in code: 38 | a = a*len(dictionary) + dictionary.index(c) 39 | 40 | a = _swap_endianness(a) 41 | 42 | return { 43 | 'matchid': a & _bitmask64, 44 | 'outcomeid': a >> 64 & _bitmask64, 45 | 'token': a >> 128 & 0xFFFF 46 | } 47 | 48 | def encode(matchid, outcomeid, token): 49 | """Encodes (matchid, outcomeid, token) to match share code 50 | 51 | :param matchid: match id 52 | :type matchid: int 53 | :param outcomeid: outcome id 54 | :type outcomeid: int 55 | :param token: token 56 | :type token: int 57 | :return: match share code (e.g. ``CSGO-Ab1cD-xYz23-7bcD9-uVZ23-12aBc``) 58 | :rtype: str 59 | """ 60 | a = _swap_endianness((token << 128) | (outcomeid << 64) | matchid) 61 | 62 | code = '' 63 | for _ in range(25): 64 | a, r = divmod(a, len(dictionary)) 65 | code += dictionary[r] 66 | 67 | return "CSGO-%s-%s-%s-%s-%s" % (code[:5], code[5:10], code[10:15], code[15:20], code[20:]) 68 | -------------------------------------------------------------------------------- /csgo/features/items.py: -------------------------------------------------------------------------------- 1 | from csgo.enums import ECsgoGCMsg 2 | 3 | class Items(object): 4 | def __init__(self): 5 | super(Items, self).__init__() 6 | 7 | # register our handlers 8 | self.on(ECsgoGCMsg.EMsgGCCStrike15_v2_Client2GCEconPreviewDataBlockResponse, self.__handle_preview_data_block) 9 | 10 | def request_preview_data_block(self, s, a, d, m): 11 | """ 12 | Request item preview data block 13 | 14 | The parameters can be taken from ``inspect`` links either from an inventory or market. 15 | The market has the ``m`` paramter, while the inventory one has ``s``. 16 | Set the missing one to ``0``. Example ``inpsect`` links: 17 | 18 | .. code:: text 19 | 20 | steam://rungame/730/765xxxxxxxxxxxxxx/+csgo_econ_action_preview%20S11111111111111111A2222222222D33333333333333333333`` 21 | steam://rungame/730/765xxxxxxxxxxxxxx/+csgo_econ_action_preview%20M444444444444444444A2222222222D33333333333333333333`` 22 | 23 | :param s: steam id of owner (set to ``0`` if not available) 24 | :type s: :class:`int` 25 | :param a: item id 26 | :type a: :class:`int` 27 | :param d: UNKNOWN 28 | :type d: :class:`int` 29 | :param m: market id (set to ``0`` if not available) 30 | :type m: :class:`int` 31 | 32 | Response event: ``item_data_block`` 33 | 34 | :param message: `CEconItemPreviewDataBlock `_ 35 | :type message: proto message 36 | 37 | """ 38 | self.send(ECsgoGCMsg.EMsgGCCStrike15_v2_Client2GCEconPreviewDataBlockRequest, { 39 | 'param_s': s, 40 | 'param_a': a, 41 | 'param_d': d, 42 | 'param_m': m, 43 | }) 44 | 45 | def __handle_preview_data_block(self, message): 46 | self.emit("item_data_block", message.iteminfo) 47 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | define HELPBODY 2 | Available commands: 3 | 4 | make help - this thing. 5 | 6 | make init - install python dependancies 7 | make test - run tests and coverage 8 | make pylint - code analysis 9 | make build - pylint + test 10 | make docs - generate html docs using sphinx 11 | 12 | make dist - build source distribution 13 | mage register - register in pypi 14 | make upload - upload to pypi 15 | 16 | make pb_fetch - fetch protobufs from SteamRE 17 | make pb_compile - compile with protoc 18 | make pb_clear - removes *.proto 19 | make pb_update - pb_fetch + pb_compile 20 | 21 | endef 22 | 23 | export HELPBODY 24 | help: 25 | @echo "$$HELPBODY" 26 | 27 | init: 28 | pip install -r requirements.txt 29 | 30 | test: 31 | coverage erase 32 | PYTHONHASHSEED=0 nosetests --verbosity 1 --with-coverage --cover-package=csgo 33 | 34 | pylint: 35 | pylint -r n -f colorized csgo || true 36 | 37 | build: pylint test docs 38 | 39 | .FORCE: 40 | docs: .FORCE 41 | $(MAKE) -C docs html 42 | 43 | clean: 44 | rm -rf dist csgo.egg-info csgo/*.pyc 45 | 46 | dist: clean 47 | python setup.py sdist 48 | 49 | register: 50 | python setup.py register -r pypi 51 | 52 | upload: dist register 53 | twine upload -r pypi dist/* 54 | 55 | pb_fetch: 56 | wget -nv --show-progress -N -P ./protobufs/ -i protobuf_list.txt 57 | sed -i '1s/^/syntax = "proto2"\;\npackage csgo\;\n/' protobufs/*.proto 58 | sed -i 's/\(optional\|repeated\) \.\([A-Z]\)/\1 csgo.\2/' protobufs/*.proto 59 | sed -i 's/cc_generic_services/py_generic_services/' protobufs/*.proto 60 | 61 | pb_compile: 62 | for filepath in `ls ./protobufs/*.proto`; do \ 63 | protoc3 --python_out ./csgo/protobufs/ --proto_path=./protobufs "$$filepath"; \ 64 | done; 65 | sed -i '/^import sys/! s/^import /import csgo.protobufs./' csgo/protobufs/*_pb2.py 66 | 67 | pb_clear: 68 | rm -f ./protobufs/*.proto ./csgo/protobufs/*_pb2.py 69 | 70 | gen_enums: 71 | python gen_enum_from_protos.py > csgo/proto_enums.py 72 | 73 | pb_update: pb_fetch pb_compile gen_enums 74 | -------------------------------------------------------------------------------- /gen_enum_from_protos.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import re 4 | from keyword import kwlist 5 | from google.protobuf.internal.enum_type_wrapper import EnumTypeWrapper 6 | from csgo import common_enums 7 | 8 | kwlist = set(kwlist + ['None']) 9 | 10 | _proto_modules = ['gcsystemmsgs_pb2', 11 | 'gcsdk_gcmessages_pb2', 12 | 'cstrike15_gcmessages_pb2', 13 | 'econ_gcmessages_pb2', 14 | ] 15 | 16 | _proto_module = __import__("csgo.protobufs", globals(), locals(), _proto_modules, 0) 17 | 18 | classes = {} 19 | 20 | for name in _proto_modules: 21 | 22 | proto = getattr(_proto_module, name) 23 | gvars = globals() 24 | 25 | for class_name, value in proto.__dict__.items(): 26 | if not isinstance(value, EnumTypeWrapper) or hasattr(common_enums, class_name): 27 | continue 28 | 29 | attrs_starting_with_number = False 30 | attrs = {} 31 | 32 | for ikey, ivalue in value.items(): 33 | ikey = re.sub(r'^(k_)?(%s_)?' % class_name, '', ikey) 34 | attrs[ikey] = ivalue 35 | 36 | if ikey[0:1].isdigit() or ikey in kwlist: 37 | attrs_starting_with_number = True 38 | 39 | classes[class_name] = attrs, attrs_starting_with_number 40 | 41 | # Generate print out 42 | 43 | print("from enum import IntEnum") 44 | 45 | for class_name, (attrs, attrs_starting_with_number) in sorted(classes.items(), key=lambda x: x[0].lower()): 46 | if attrs_starting_with_number: 47 | print("\n%s = IntEnum(%r, {" % (class_name, class_name)) 48 | for ikey, ivalue in attrs.items(): 49 | print(" %r: %r," % (ikey, ivalue)) 50 | print(" })") 51 | else: 52 | print("\nclass {class_name}(IntEnum):".format(class_name=class_name)) 53 | for ikey, ivalue in sorted(attrs.items(), key=lambda y: y[1]): 54 | print(" {} = {}".format(ikey, ivalue)) 55 | 56 | print("\n__all__ = [") 57 | 58 | for class_name in sorted(classes, key=lambda x: x.lower()): 59 | print(" %r," % class_name) 60 | 61 | print(" ]") 62 | -------------------------------------------------------------------------------- /csgo/msg.py: -------------------------------------------------------------------------------- 1 | """ 2 | Various utility function for dealing with messages. 3 | 4 | """ 5 | 6 | from csgo.enums import EGCBaseClientMsg, ECsgoGCMsg, EGCItemMsg 7 | from csgo.protobufs import gcsdk_gcmessages_pb2 8 | from csgo.protobufs import cstrike15_gcmessages_pb2 9 | from csgo.protobufs import econ_gcmessages_pb2 10 | from csgo.protobufs import base_gcmessages_pb2 11 | 12 | 13 | def get_emsg_enum(emsg): 14 | """ 15 | Attempts to find the Enum for the given :class:`int` 16 | 17 | :param emsg: integer corresponding to a Enum 18 | :type emsg: :class:`int` 19 | :return: Enum if found, `emsg` if not 20 | :rtype: Enum, :class:`int` 21 | """ 22 | for enum in (EGCBaseClientMsg, 23 | ECsgoGCMsg, 24 | EGCItemMsg, 25 | ): 26 | try: 27 | return enum(emsg) 28 | except ValueError: 29 | pass 30 | 31 | return emsg 32 | 33 | def find_proto(emsg): 34 | """ 35 | Attempts to find the protobuf message for a given Enum 36 | 37 | :param emsg: Enum corrensponding to a protobuf message 38 | :type emsg: `Enum` 39 | :return: protobuf message class 40 | """ 41 | 42 | if type(emsg) is int: 43 | return None 44 | 45 | proto = _proto_map_why_cant_we_name_things_properly.get(emsg, None) 46 | 47 | if proto is not None: 48 | return proto 49 | 50 | for module in (gcsdk_gcmessages_pb2, 51 | cstrike15_gcmessages_pb2, 52 | econ_gcmessages_pb2, 53 | base_gcmessages_pb2, 54 | ): 55 | 56 | proto = getattr(module, emsg.name.replace("EMsg", "CMsg"), None) 57 | 58 | if proto is None: 59 | proto = getattr(module, emsg.name.replace("EMsgGC", "CMsg"), None) 60 | 61 | if proto is not None: 62 | break 63 | 64 | return proto 65 | 66 | 67 | _proto_map_why_cant_we_name_things_properly = { 68 | EGCBaseClientMsg.EMsgGCClientConnectionStatus: gcsdk_gcmessages_pb2.CMsgConnectionStatus, 69 | EGCBaseClientMsg.EMsgGCClientHelloPartner: gcsdk_gcmessages_pb2.CMsgClientHello, 70 | EGCBaseClientMsg.EMsgGCClientHelloPW: gcsdk_gcmessages_pb2.CMsgClientHello, 71 | EGCBaseClientMsg.EMsgGCClientHelloR2: gcsdk_gcmessages_pb2.CMsgClientHello, 72 | EGCBaseClientMsg.EMsgGCClientHelloR3: gcsdk_gcmessages_pb2.CMsgClientHello, 73 | EGCBaseClientMsg.EMsgGCClientHelloR4: gcsdk_gcmessages_pb2.CMsgClientHello, 74 | ECsgoGCMsg.EMsgGCCStrike15_v2_ClientRequestWatchInfoFriends2: cstrike15_gcmessages_pb2.CMsgGCCStrike15_v2_ClientRequestWatchInfoFriends, 75 | ECsgoGCMsg.EMsgGCCStrike15_v2_GC2ClientGlobalStats: cstrike15_gcmessages_pb2.GlobalStatistics, 76 | } 77 | -------------------------------------------------------------------------------- /csgo/features/player.py: -------------------------------------------------------------------------------- 1 | from csgo.enums import ECsgoGCMsg 2 | 3 | class Player(object): 4 | ranks_map = { 5 | 0: "Not Ranked", 6 | 1: "Silver I", 7 | 2: "Silver II", 8 | 3: "Silver III", 9 | 4: "Silver IV", 10 | 5: "Silver Elite", 11 | 6: "Silver Elite Master", 12 | 7: "Gold Nova I", 13 | 8: "Gold Nova II", 14 | 9: "Gold Nova III", 15 | 10: "Gold Nova Master", 16 | 11: "Master Guardian I", 17 | 12: "Master Guardian II", 18 | 13: "Master Guardian Elite", 19 | 14: "Distinguished Master Guardian", 20 | 15: "Legendary Eagle", 21 | 16: "Legendary Eagle Master", 22 | 17: "Supreme Master First Class", 23 | 18: "The Global Elite" 24 | } 25 | """:class:`dict` mapping rank id to name""" 26 | wingman_ranks_map = ranks_map 27 | """:class:`dict` mapping wingman rank id to name""" 28 | dangerzone_ranks_map = { 29 | 0: "Hidden", 30 | 1: "Lab Rat I", 31 | 2: "Lab Rat II", 32 | 3: "Sprinting Hare I", 33 | 4: "Sprinting Hare II", 34 | 5: "Wild Scout I", 35 | 6: "Wild Scout II", 36 | 7: "Wild Scout Elite", 37 | 8: "Hunter Fox I", 38 | 9: "Hunter Fox II", 39 | 10: "Hunter Fox II", 40 | 11: "Hunter Fox Elite", 41 | 12: "Timber Wolf", 42 | 13: "Ember Wolf", 43 | 14: "Wildfire Wolf", 44 | 15: "The Howling Alpha", 45 | } 46 | """:class:`dict` mapping dangerzone rank id to name""" 47 | levels_map = { 48 | 0: 'Not Recruited', 49 | 1: 'Recruit', 50 | 2: 'Private', 51 | 3: 'Private', 52 | 4: 'Private', 53 | 5: 'Corporal', 54 | 6: 'Corporal', 55 | 7: 'Corporal', 56 | 8: 'Corporal', 57 | 9: 'Sergeant', 58 | 10: 'Sergeant', 59 | 11: 'Sergeant', 60 | 12: 'Sergeant', 61 | 13: 'Master Sergeant', 62 | 14: 'Master Sergeant', 63 | 15: 'Master Sergeant', 64 | 16: 'Master Sergeant', 65 | 17: 'Sergeant Major', 66 | 18: 'Sergeant Major', 67 | 19: 'Sergeant Major', 68 | 20: 'Sergeant Major', 69 | 21: 'Lieutenant', 70 | 22: 'Lieutenant', 71 | 23: 'Lieutenant', 72 | 24: 'Lieutenant', 73 | 25: 'Captain', 74 | 26: 'Captain', 75 | 27: 'Captain', 76 | 28: 'Captain', 77 | 29: 'Major', 78 | 30: 'Major', 79 | 31: 'Major', 80 | 32: 'Major', 81 | 33: 'Colonel', 82 | 34: 'Colonel', 83 | 35: 'Colonel', 84 | 36: 'Brigadier General', 85 | 37: 'Major General', 86 | 38: 'Lieutenant General', 87 | 39: 'General', 88 | 40: 'Global General' 89 | } 90 | """:class:`dict` mapping level to name""" 91 | 92 | 93 | def __init__(self): 94 | super(Player, self).__init__() 95 | 96 | # register our handlers 97 | self.on(ECsgoGCMsg.EMsgGCCStrike15_v2_PlayersProfile, self.__handle_player_profile) 98 | 99 | def request_player_profile(self, account_id, request_level=32): 100 | """ 101 | Request player profile 102 | 103 | :param account_id: account id 104 | :type account_id: :class:`int` 105 | :param request_level: no clue what this is used for; if you do, please make pull request 106 | :type request_level: :class:`int` 107 | 108 | Response event: ``player_profile`` 109 | 110 | :param message: `CMsgGCCStrike15_v2_MatchmakingGC2ClientHello `_ 111 | :type message: proto message 112 | 113 | """ 114 | self.send(ECsgoGCMsg.EMsgGCCStrike15_v2_ClientRequestPlayersProfile, { 115 | 'account_id': account_id, 116 | 'request_level': request_level, 117 | }) 118 | 119 | def __handle_player_profile(self, message): 120 | if message.account_profiles: 121 | self.emit("player_profile", message.account_profiles[0]) 122 | -------------------------------------------------------------------------------- /docs/user_guide.rst: -------------------------------------------------------------------------------- 1 | User Guide 2 | ********** 3 | 4 | This part of the documentation is a quick start for writing applications that 5 | interact with the game coordinator for CSGO. 6 | 7 | 8 | Initialization 9 | ============== 10 | 11 | This is the minimal code we need to get a session with the game coordnator. 12 | 13 | .. code:: python 14 | 15 | from steam.client import SteamClient 16 | from csgo.client import CSGOClient 17 | 18 | client = SteamClient() 19 | cs = CSGOClient(client) 20 | 21 | @client.on('logged_on') 22 | def start_csgo(): 23 | cs.launch() 24 | 25 | @cs.on('ready') 26 | def gc_ready(): 27 | # send messages to gc 28 | pass 29 | 30 | client.cli_login() 31 | client.run_forever() 32 | 33 | 34 | | You won't see any output running the code above. 35 | | In order to peek inside we need to setup debug logging. 36 | 37 | See the :ref:`logging_config` section 38 | 39 | Sending/Recieving messages 40 | ========================== 41 | 42 | Let's request profile of the currently logged on user. We only need the account id. 43 | If need to convert from steam id or any other format see `SteamID `_. 44 | 45 | .. code:: python 46 | 47 | from csgo.enums import ECsgoGCMsg 48 | 49 | # send request message 50 | self.send(ECsgoGCMsg.EMsgGCCStrike15_v2_ClientRequestPlayersProfile, { 51 | 'account_id': cs.account_id, 52 | 'request_level': 32, 53 | }) 54 | 55 | # listen for the response 56 | response, = cs.wait_event(ECsgoGCMsg.EMsgGCCStrike15_v2_PlayersProfile, timeout=10) 57 | player_profle = response.account_profiles[0] 58 | 59 | Alternatively, we can do the same using one of the methods from :any:`csgo.features`, which implements 60 | that particular request for us. Specifically :attr:`csgo.features.player.Player.request_player_profile` 61 | 62 | .. code:: python 63 | 64 | cs.request_player_profile(cs.account_id) 65 | response, = cs.wait_event('player_profile') 66 | 67 | .. code:: python 68 | 69 | >>> str(response) 70 | account_id: 12345678 71 | ranking { 72 | account_id: 12345678 73 | rank_id: 0 74 | wins: 123 75 | } 76 | commendation { 77 | cmd_friendly: 1 78 | cmd_teaching: 2 79 | cmd_leader: 3 80 | } 81 | medals { 82 | medal_team: 0 83 | medal_combat: 0 84 | medal_weapon: 0 85 | medal_global: 0 86 | medal_arms: 0 87 | } 88 | player_level: 1 89 | player_cur_xp: 262840000 90 | 91 | .. _working_with_events: 92 | 93 | Working with events 94 | =================== 95 | 96 | The module makes use of `gevent `_ 97 | and `gevent-eventemitter `_. 98 | Events work similiarly to ``EventEmitter`` in javascript. 99 | Nevertheless, here is quick rundown. 100 | 101 | To catch an event we need to register a callback 102 | 103 | .. code:: python 104 | 105 | @cs.on('my event') 106 | def do_stuff(a, b): 107 | print "Hey!" 108 | 109 | cs.on('my event', do_stuff) 110 | cs.once('my event', do_stuff) # call do_stuff just one time 111 | cs.wait_event('my event') # blocks and returns arguments, if any 112 | 113 | .. note:: 114 | ``wait_event`` may block forever, so use the ``timeout`` parameter 115 | 116 | Emitting an event is just as simple. 117 | 118 | .. code:: python 119 | 120 | cs.emit("my event") 121 | cs.emit("my event", 1, [3,4,5]) # optional arguments 122 | 123 | 124 | That's it. For more details see `gevent-eventemitter `_. 125 | 126 | 127 | .. _logging_config: 128 | 129 | Configure console logging 130 | ========================= 131 | 132 | Here is a basic configuration to get debug messages in the console. 133 | 134 | .. code:: python 135 | 136 | import logging 137 | 138 | logging.basicConfig(format='[%(asctime)s] %(levelname)s %(name)s: %(message)s', level=logging.DEBUG) 139 | 140 | The we run the program and the console ouput should look something like this: 141 | 142 | .. code:: 143 | 144 | [2016-01-01 12:34:56,000] DEBUG CMClient: Connect initiated. 145 | [2016-01-01 12:34:56,000] DEBUG Connection: Attempting connection to ('208.78.164.13', 27018) 146 | [2016-01-01 12:34:56,000] DEBUG Connection: Connected. 147 | [2016-01-01 12:34:56,000] DEBUG CMClient: Emit event: 'connected' 148 | [2016-01-01 12:34:56,000] DEBUG SteamClient: Emit event: 'connected' 149 | [2016-01-01 12:34:56,000] DEBUG SteamClient: Attempting login 150 | [2016-01-01 12:34:56,000] DEBUG CMClient: Incoming: > 151 | [2016-01-01 12:34:56,000] DEBUG CMClient: Emit event: 152 | ... 153 | 154 | 155 | -------------------------------------------------------------------------------- /csgo/features/match.py: -------------------------------------------------------------------------------- 1 | from csgo.enums import ECsgoGCMsg 2 | 3 | class Match(object): 4 | def __init__(self): 5 | super(Match, self).__init__() 6 | 7 | # register our handlers 8 | self.on(ECsgoGCMsg.EMsgGCCStrike15_v2_MatchmakingGC2ClientHello, self.__handle_mmstats) 9 | self.on(ECsgoGCMsg.EMsgGCCStrike15_v2_MatchList, self.__handle_match_list) 10 | self.on(ECsgoGCMsg.EMsgGCCStrike15_v2_WatchInfoUsers, self.__handle_watch_info) 11 | 12 | def request_matchmaking_stats(self): 13 | """ 14 | Request matchmaking statistics 15 | 16 | Response event: ``matchmaking_stats`` 17 | 18 | :param message: `CMsgGCCStrike15_v2_MatchmakingGC2ClientHello `_ 19 | :type message: proto message 20 | 21 | """ 22 | self.send(ECsgoGCMsg.EMsgGCCStrike15_v2_MatchmakingClient2GCHello) 23 | 24 | def __handle_mmstats(self, message): 25 | self.emit("matchmaking_stats", message) 26 | 27 | def request_current_live_games(self): 28 | """ 29 | Request current live games 30 | 31 | Response event: ``current_live_games`` 32 | 33 | :param message: `CMsgGCCStrike15_v2_MatchList `_ 34 | :type message: proto message 35 | 36 | """ 37 | self.send(ECsgoGCMsg.EMsgGCCStrike15_v2_MatchListRequestCurrentLiveGames) 38 | 39 | def request_live_game_for_user(self, account_id): 40 | """ 41 | .. warning:: 42 | Deprecated. CSGO no longer reponds for this method 43 | 44 | Request recent games for a specific user 45 | 46 | :param account_id: account id of the user 47 | :type account_id: :class:`int` 48 | 49 | Response event: ``live_game_for_user`` 50 | 51 | :param message: `CMsgGCCStrike15_v2_MatchList `_ 52 | :type message: proto message 53 | 54 | """ 55 | self.send(ECsgoGCMsg.EMsgGCCStrike15_v2_MatchListRequestLiveGameForUser, { 56 | 'accountid': account_id, 57 | }) 58 | 59 | def request_full_match_info(self, matchid, outcomeid, token): 60 | """ 61 | Request full match info. The parameters can be decoded from a match ShareCode 62 | 63 | :param matchid: match id 64 | :type matchid: :class:`int` 65 | :param outcomeid: outcome id 66 | :type outcomeid: :class:`int` 67 | :param token: token 68 | :type token: :class:`int` 69 | 70 | Response event: ``full_match_info`` 71 | 72 | :param message: `CMsgGCCStrike15_v2_MatchList `_ 73 | :type message: proto message 74 | """ 75 | self.send(ECsgoGCMsg.EMsgGCCStrike15_v2_MatchListRequestFullGameInfo, { 76 | 'matchid': matchid, 77 | 'outcomeid': outcomeid, 78 | 'token': token, 79 | }) 80 | 81 | def request_recent_user_games(self, account_id): 82 | """ 83 | Request recent games for a specific user 84 | 85 | :param account_id: account id of the user 86 | :type account_id: :class:`int` 87 | 88 | Response event: ``recent_user_games`` 89 | 90 | :param message: `CMsgGCCStrike15_v2_MatchList `_ 91 | :type message: proto message 92 | """ 93 | self.send(ECsgoGCMsg.EMsgGCCStrike15_v2_MatchListRequestRecentUserGames, { 94 | 'accountid': account_id, 95 | }) 96 | 97 | def __handle_match_list(self, message): 98 | emsg = message.msgrequestid 99 | 100 | if emsg == ECsgoGCMsg.EMsgGCCStrike15_v2_MatchListRequestCurrentLiveGames: 101 | self.emit("current_live_games", message) 102 | elif emsg == ECsgoGCMsg.EMsgGCCStrike15_v2_MatchListRequestLiveGameForUser: 103 | self.emit("live_game_for_user", message) 104 | elif emsg == ECsgoGCMsg.EMsgGCCStrike15_v2_MatchListRequestRecentUserGames: 105 | self.emit("recent_user_games", message) 106 | elif emsg == ECsgoGCMsg.EMsgGCCStrike15_v2_MatchListRequestFullGameInfo: 107 | self.emit("full_match_info", message) 108 | 109 | 110 | def request_watch_info_friends(self, account_ids, request_id=1, serverid=0, matchid=0): 111 | """Request watch info for friends 112 | 113 | :param account_ids: list of account ids 114 | :type account_ids: list 115 | :param request_id: request id, used to match reponse with request (default: 1) 116 | :type request_id: int 117 | :param serverid: server id 118 | :type serverid: int 119 | :param matchid: match id 120 | :type matchid: int 121 | 122 | Response event: ``watch_info`` 123 | 124 | :param message: `CMsgGCCStrike15_v2_WatchInfoUsers `_ 125 | :type message: proto message 126 | """ 127 | self.send(ECsgoGCMsg.EMsgGCCStrike15_v2_ClientRequestWatchInfoFriends2, { 128 | 'account_ids': account_ids, 129 | 'request_id': request_id, 130 | 'serverid': serverid, 131 | 'matchid': matchid 132 | }) 133 | 134 | def __handle_watch_info(self, message): 135 | self.emit("watch_info", message) 136 | -------------------------------------------------------------------------------- /csgo/protobufs/engine_gcmessages_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: engine_gcmessages.proto 4 | 5 | import sys 6 | _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) 7 | from google.protobuf import descriptor as _descriptor 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | # @@protoc_insertion_point(imports) 12 | 13 | _sym_db = _symbol_database.Default() 14 | 15 | 16 | from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 17 | 18 | 19 | DESCRIPTOR = _descriptor.FileDescriptor( 20 | name='engine_gcmessages.proto', 21 | package='csgo', 22 | syntax='proto2', 23 | serialized_options=_b('\220\001\000'), 24 | serialized_pb=_b('\n\x17\x65ngine_gcmessages.proto\x12\x04\x63sgo\x1a google/protobuf/descriptor.proto\"\xdd\x01\n\x15\x43\x45ngineGotvSyncPacket\x12\x10\n\x08match_id\x18\x01 \x01(\x04\x12\x13\n\x0binstance_id\x18\x02 \x01(\r\x12\x16\n\x0esignupfragment\x18\x03 \x01(\r\x12\x17\n\x0f\x63urrentfragment\x18\x04 \x01(\r\x12\x10\n\x08tickrate\x18\x05 \x01(\x02\x12\x0c\n\x04tick\x18\x06 \x01(\r\x12\x0f\n\x07rtdelay\x18\x08 \x01(\x02\x12\x0e\n\x06rcvage\x18\t \x01(\x02\x12\x19\n\x11keyframe_interval\x18\n \x01(\x02\x12\x10\n\x08\x63\x64ndelay\x18\x0b \x01(\rB\x03\x90\x01\x00') 25 | , 26 | dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,]) 27 | 28 | 29 | 30 | 31 | _CENGINEGOTVSYNCPACKET = _descriptor.Descriptor( 32 | name='CEngineGotvSyncPacket', 33 | full_name='csgo.CEngineGotvSyncPacket', 34 | filename=None, 35 | file=DESCRIPTOR, 36 | containing_type=None, 37 | fields=[ 38 | _descriptor.FieldDescriptor( 39 | name='match_id', full_name='csgo.CEngineGotvSyncPacket.match_id', index=0, 40 | number=1, type=4, cpp_type=4, label=1, 41 | has_default_value=False, default_value=0, 42 | message_type=None, enum_type=None, containing_type=None, 43 | is_extension=False, extension_scope=None, 44 | serialized_options=None, file=DESCRIPTOR), 45 | _descriptor.FieldDescriptor( 46 | name='instance_id', full_name='csgo.CEngineGotvSyncPacket.instance_id', index=1, 47 | number=2, type=13, cpp_type=3, label=1, 48 | has_default_value=False, default_value=0, 49 | message_type=None, enum_type=None, containing_type=None, 50 | is_extension=False, extension_scope=None, 51 | serialized_options=None, file=DESCRIPTOR), 52 | _descriptor.FieldDescriptor( 53 | name='signupfragment', full_name='csgo.CEngineGotvSyncPacket.signupfragment', index=2, 54 | number=3, type=13, cpp_type=3, label=1, 55 | has_default_value=False, default_value=0, 56 | message_type=None, enum_type=None, containing_type=None, 57 | is_extension=False, extension_scope=None, 58 | serialized_options=None, file=DESCRIPTOR), 59 | _descriptor.FieldDescriptor( 60 | name='currentfragment', full_name='csgo.CEngineGotvSyncPacket.currentfragment', index=3, 61 | number=4, type=13, cpp_type=3, label=1, 62 | has_default_value=False, default_value=0, 63 | message_type=None, enum_type=None, containing_type=None, 64 | is_extension=False, extension_scope=None, 65 | serialized_options=None, file=DESCRIPTOR), 66 | _descriptor.FieldDescriptor( 67 | name='tickrate', full_name='csgo.CEngineGotvSyncPacket.tickrate', index=4, 68 | number=5, type=2, cpp_type=6, label=1, 69 | has_default_value=False, default_value=float(0), 70 | message_type=None, enum_type=None, containing_type=None, 71 | is_extension=False, extension_scope=None, 72 | serialized_options=None, file=DESCRIPTOR), 73 | _descriptor.FieldDescriptor( 74 | name='tick', full_name='csgo.CEngineGotvSyncPacket.tick', index=5, 75 | number=6, type=13, cpp_type=3, label=1, 76 | has_default_value=False, default_value=0, 77 | message_type=None, enum_type=None, containing_type=None, 78 | is_extension=False, extension_scope=None, 79 | serialized_options=None, file=DESCRIPTOR), 80 | _descriptor.FieldDescriptor( 81 | name='rtdelay', full_name='csgo.CEngineGotvSyncPacket.rtdelay', index=6, 82 | number=8, type=2, cpp_type=6, label=1, 83 | has_default_value=False, default_value=float(0), 84 | message_type=None, enum_type=None, containing_type=None, 85 | is_extension=False, extension_scope=None, 86 | serialized_options=None, file=DESCRIPTOR), 87 | _descriptor.FieldDescriptor( 88 | name='rcvage', full_name='csgo.CEngineGotvSyncPacket.rcvage', index=7, 89 | number=9, type=2, cpp_type=6, label=1, 90 | has_default_value=False, default_value=float(0), 91 | message_type=None, enum_type=None, containing_type=None, 92 | is_extension=False, extension_scope=None, 93 | serialized_options=None, file=DESCRIPTOR), 94 | _descriptor.FieldDescriptor( 95 | name='keyframe_interval', full_name='csgo.CEngineGotvSyncPacket.keyframe_interval', index=8, 96 | number=10, type=2, cpp_type=6, label=1, 97 | has_default_value=False, default_value=float(0), 98 | message_type=None, enum_type=None, containing_type=None, 99 | is_extension=False, extension_scope=None, 100 | serialized_options=None, file=DESCRIPTOR), 101 | _descriptor.FieldDescriptor( 102 | name='cdndelay', full_name='csgo.CEngineGotvSyncPacket.cdndelay', index=9, 103 | number=11, type=13, cpp_type=3, label=1, 104 | has_default_value=False, default_value=0, 105 | message_type=None, enum_type=None, containing_type=None, 106 | is_extension=False, extension_scope=None, 107 | serialized_options=None, file=DESCRIPTOR), 108 | ], 109 | extensions=[ 110 | ], 111 | nested_types=[], 112 | enum_types=[ 113 | ], 114 | serialized_options=None, 115 | is_extendable=False, 116 | syntax='proto2', 117 | extension_ranges=[], 118 | oneofs=[ 119 | ], 120 | serialized_start=68, 121 | serialized_end=289, 122 | ) 123 | 124 | DESCRIPTOR.message_types_by_name['CEngineGotvSyncPacket'] = _CENGINEGOTVSYNCPACKET 125 | _sym_db.RegisterFileDescriptor(DESCRIPTOR) 126 | 127 | CEngineGotvSyncPacket = _reflection.GeneratedProtocolMessageType('CEngineGotvSyncPacket', (_message.Message,), dict( 128 | DESCRIPTOR = _CENGINEGOTVSYNCPACKET, 129 | __module__ = 'engine_gcmessages_pb2' 130 | # @@protoc_insertion_point(class_scope:csgo.CEngineGotvSyncPacket) 131 | )) 132 | _sym_db.RegisterMessage(CEngineGotvSyncPacket) 133 | 134 | 135 | DESCRIPTOR._options = None 136 | # @@protoc_insertion_point(module_scope) 137 | -------------------------------------------------------------------------------- /protobufs/gcsystemmsgs.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package csgo; 3 | option optimize_for = SPEED; 4 | option py_generic_services = false; 5 | 6 | enum EGCSystemMsg { 7 | k_EGCMsgInvalid = 0; 8 | k_EGCMsgMulti = 1; 9 | k_EGCMsgGenericReply = 10; 10 | k_EGCMsgSystemBase = 50; 11 | k_EGCMsgAchievementAwarded = 51; 12 | k_EGCMsgConCommand = 52; 13 | k_EGCMsgStartPlaying = 53; 14 | k_EGCMsgStopPlaying = 54; 15 | k_EGCMsgStartGameserver = 55; 16 | k_EGCMsgStopGameserver = 56; 17 | k_EGCMsgWGRequest = 57; 18 | k_EGCMsgWGResponse = 58; 19 | k_EGCMsgGetUserGameStatsSchema = 59; 20 | k_EGCMsgGetUserGameStatsSchemaResponse = 60; 21 | k_EGCMsgGetUserStatsDEPRECATED = 61; 22 | k_EGCMsgGetUserStatsResponse = 62; 23 | k_EGCMsgAppInfoUpdated = 63; 24 | k_EGCMsgValidateSession = 64; 25 | k_EGCMsgValidateSessionResponse = 65; 26 | k_EGCMsgLookupAccountFromInput = 66; 27 | k_EGCMsgSendHTTPRequest = 67; 28 | k_EGCMsgSendHTTPRequestResponse = 68; 29 | k_EGCMsgPreTestSetup = 69; 30 | k_EGCMsgRecordSupportAction = 70; 31 | k_EGCMsgGetAccountDetails_DEPRECATED = 71; 32 | k_EGCMsgReceiveInterAppMessage = 73; 33 | k_EGCMsgFindAccounts = 74; 34 | k_EGCMsgPostAlert = 75; 35 | k_EGCMsgGetLicenses = 76; 36 | k_EGCMsgGetUserStats = 77; 37 | k_EGCMsgGetCommands = 78; 38 | k_EGCMsgGetCommandsResponse = 79; 39 | k_EGCMsgAddFreeLicense = 80; 40 | k_EGCMsgAddFreeLicenseResponse = 81; 41 | k_EGCMsgGetIPLocation = 82; 42 | k_EGCMsgGetIPLocationResponse = 83; 43 | k_EGCMsgSystemStatsSchema = 84; 44 | k_EGCMsgGetSystemStats = 85; 45 | k_EGCMsgGetSystemStatsResponse = 86; 46 | k_EGCMsgSendEmail = 87; 47 | k_EGCMsgSendEmailResponse = 88; 48 | k_EGCMsgGetEmailTemplate = 89; 49 | k_EGCMsgGetEmailTemplateResponse = 90; 50 | k_EGCMsgGrantGuestPass = 91; 51 | k_EGCMsgGrantGuestPassResponse = 92; 52 | k_EGCMsgGetAccountDetails = 93; 53 | k_EGCMsgGetAccountDetailsResponse = 94; 54 | k_EGCMsgGetPersonaNames = 95; 55 | k_EGCMsgGetPersonaNamesResponse = 96; 56 | k_EGCMsgMultiplexMsg = 97; 57 | k_EGCMsgMultiplexMsgResponse = 98; 58 | k_EGCMsgWebAPIRegisterInterfaces = 101; 59 | k_EGCMsgWebAPIJobRequest = 102; 60 | k_EGCMsgWebAPIJobRequestHttpResponse = 104; 61 | k_EGCMsgWebAPIJobRequestForwardResponse = 105; 62 | k_EGCMsgMemCachedGet = 200; 63 | k_EGCMsgMemCachedGetResponse = 201; 64 | k_EGCMsgMemCachedSet = 202; 65 | k_EGCMsgMemCachedDelete = 203; 66 | k_EGCMsgMemCachedStats = 204; 67 | k_EGCMsgMemCachedStatsResponse = 205; 68 | k_EGCMsgMasterSetDirectory = 220; 69 | k_EGCMsgMasterSetDirectoryResponse = 221; 70 | k_EGCMsgMasterSetWebAPIRouting = 222; 71 | k_EGCMsgMasterSetWebAPIRoutingResponse = 223; 72 | k_EGCMsgMasterSetClientMsgRouting = 224; 73 | k_EGCMsgMasterSetClientMsgRoutingResponse = 225; 74 | k_EGCMsgSetOptions = 226; 75 | k_EGCMsgSetOptionsResponse = 227; 76 | k_EGCMsgSystemBase2 = 500; 77 | k_EGCMsgGetPurchaseTrustStatus = 501; 78 | k_EGCMsgGetPurchaseTrustStatusResponse = 502; 79 | k_EGCMsgUpdateSession = 503; 80 | k_EGCMsgGCAccountVacStatusChange = 504; 81 | k_EGCMsgCheckFriendship = 505; 82 | k_EGCMsgCheckFriendshipResponse = 506; 83 | k_EGCMsgGetPartnerAccountLink = 507; 84 | k_EGCMsgGetPartnerAccountLinkResponse = 508; 85 | k_EGCMsgDPPartnerMicroTxns = 512; 86 | k_EGCMsgDPPartnerMicroTxnsResponse = 513; 87 | k_EGCMsgVacVerificationChange = 518; 88 | k_EGCMsgAccountPhoneNumberChange = 519; 89 | k_EGCMsgInviteUserToLobby = 523; 90 | k_EGCMsgGetGamePersonalDataCategoriesRequest = 524; 91 | k_EGCMsgGetGamePersonalDataCategoriesResponse = 525; 92 | k_EGCMsgGetGamePersonalDataEntriesRequest = 526; 93 | k_EGCMsgGetGamePersonalDataEntriesResponse = 527; 94 | k_EGCMsgTerminateGamePersonalDataEntriesRequest = 528; 95 | k_EGCMsgTerminateGamePersonalDataEntriesResponse = 529; 96 | } 97 | 98 | enum ESOMsg { 99 | k_ESOMsg_Create = 21; 100 | k_ESOMsg_Update = 22; 101 | k_ESOMsg_Destroy = 23; 102 | k_ESOMsg_CacheSubscribed = 24; 103 | k_ESOMsg_CacheUnsubscribed = 25; 104 | k_ESOMsg_UpdateMultiple = 26; 105 | k_ESOMsg_CacheSubscriptionCheck = 27; 106 | k_ESOMsg_CacheSubscriptionRefresh = 28; 107 | } 108 | 109 | enum EGCBaseClientMsg { 110 | k_EMsgGCClientWelcome = 4004; 111 | k_EMsgGCServerWelcome = 4005; 112 | k_EMsgGCClientHello = 4006; 113 | k_EMsgGCServerHello = 4007; 114 | k_EMsgGCClientConnectionStatus = 4009; 115 | k_EMsgGCServerConnectionStatus = 4010; 116 | k_EMsgGCClientHelloPartner = 4011; 117 | k_EMsgGCClientHelloPW = 4012; 118 | k_EMsgGCClientHelloR2 = 4013; 119 | k_EMsgGCClientHelloR3 = 4014; 120 | k_EMsgGCClientHelloR4 = 4015; 121 | } 122 | 123 | enum EGCToGCMsg { 124 | k_EGCToGCMsgMasterAck = 150; 125 | k_EGCToGCMsgMasterAckResponse = 151; 126 | k_EGCToGCMsgRouted = 152; 127 | k_EGCToGCMsgRoutedReply = 153; 128 | k_EMsgUpdateSessionIP = 154; 129 | k_EMsgRequestSessionIP = 155; 130 | k_EMsgRequestSessionIPResponse = 156; 131 | k_EGCToGCMsgMasterStartupComplete = 157; 132 | } 133 | 134 | enum ECommunityItemClass { 135 | k_ECommunityItemClass_Invalid = 0; 136 | k_ECommunityItemClass_Badge = 1; 137 | k_ECommunityItemClass_GameCard = 2; 138 | k_ECommunityItemClass_ProfileBackground = 3; 139 | k_ECommunityItemClass_Emoticon = 4; 140 | k_ECommunityItemClass_BoosterPack = 5; 141 | k_ECommunityItemClass_Consumable = 6; 142 | k_ECommunityItemClass_GameGoo = 7; 143 | k_ECommunityItemClass_ProfileModifier = 8; 144 | k_ECommunityItemClass_Scene = 9; 145 | k_ECommunityItemClass_SalienItem = 10; 146 | } 147 | 148 | enum ECommunityItemAttribute { 149 | k_ECommunityItemAttribute_Invalid = 0; 150 | k_ECommunityItemAttribute_CardBorder = 1; 151 | k_ECommunityItemAttribute_Level = 2; 152 | k_ECommunityItemAttribute_IssueNumber = 3; 153 | k_ECommunityItemAttribute_TradableTime = 4; 154 | k_ECommunityItemAttribute_StorePackageID = 5; 155 | k_ECommunityItemAttribute_CommunityItemAppID = 6; 156 | k_ECommunityItemAttribute_CommunityItemType = 7; 157 | k_ECommunityItemAttribute_ProfileModiferEnabled = 8; 158 | k_ECommunityItemAttribute_ExpiryTime = 9; 159 | } 160 | 161 | message CMsgGCHVacVerificationChange { 162 | optional fixed64 steamid = 1; 163 | optional uint32 appid = 2; 164 | optional bool is_verified = 3; 165 | } 166 | 167 | message CMsgGCHAccountPhoneNumberChange { 168 | optional fixed64 steamid = 1; 169 | optional uint32 appid = 2; 170 | optional uint64 phone_id = 3; 171 | optional bool is_verified = 4; 172 | optional bool is_identifying = 5; 173 | } 174 | 175 | message CMsgGCHInviteUserToLobby { 176 | optional fixed64 steamid = 1; 177 | optional uint32 appid = 2; 178 | optional fixed64 steamid_invited = 3; 179 | optional fixed64 steamid_lobby = 4; 180 | } 181 | 182 | message CQuest_PublisherAddCommunityItemsToPlayer_Request { 183 | message Attribute { 184 | optional uint32 attribute = 1; 185 | optional uint64 value = 2; 186 | } 187 | 188 | optional uint64 steamid = 1; 189 | optional uint32 appid = 2; 190 | optional uint32 match_item_type = 3; 191 | optional uint32 match_item_class = 4; 192 | optional string prefix_item_name = 5; 193 | repeated csgo.CQuest_PublisherAddCommunityItemsToPlayer_Request.Attribute attributes = 6; 194 | optional string note = 7; 195 | } 196 | 197 | message CQuest_PublisherAddCommunityItemsToPlayer_Response { 198 | optional uint32 items_matched = 1; 199 | optional uint32 items_granted = 2; 200 | } 201 | 202 | message CCommunity_GamePersonalDataCategoryInfo { 203 | optional string type = 1; 204 | optional string localization_token = 2; 205 | optional string template_file = 3; 206 | } 207 | 208 | message CCommunity_GetGamePersonalDataCategories_Request { 209 | optional uint32 appid = 1; 210 | } 211 | 212 | message CCommunity_GetGamePersonalDataCategories_Response { 213 | repeated csgo.CCommunity_GamePersonalDataCategoryInfo categories = 1; 214 | optional string app_assets_basename = 2; 215 | } 216 | 217 | message CCommunity_GetGamePersonalDataEntries_Request { 218 | optional uint32 appid = 1; 219 | optional uint64 steamid = 2; 220 | optional string type = 3; 221 | optional string continue_token = 4; 222 | } 223 | 224 | message CCommunity_GetGamePersonalDataEntries_Response { 225 | optional uint32 gceresult = 1; 226 | repeated string entries = 2; 227 | optional string continue_token = 3; 228 | } 229 | 230 | message CCommunity_TerminateGamePersonalDataEntries_Request { 231 | optional uint32 appid = 1; 232 | optional uint64 steamid = 2; 233 | } 234 | 235 | message CCommunity_TerminateGamePersonalDataEntries_Response { 236 | optional uint32 gceresult = 1; 237 | } 238 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 21 | 22 | .PHONY: help 23 | help: 24 | @echo "Please use \`make ' where is one of" 25 | @echo " html to make standalone HTML files" 26 | @echo " dirhtml to make HTML files named index.html in directories" 27 | @echo " singlehtml to make a single large HTML file" 28 | @echo " pickle to make pickle files" 29 | @echo " json to make JSON files" 30 | @echo " htmlhelp to make HTML files and a HTML help project" 31 | @echo " qthelp to make HTML files and a qthelp project" 32 | @echo " applehelp to make an Apple Help Book" 33 | @echo " devhelp to make HTML files and a Devhelp project" 34 | @echo " epub to make an epub" 35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 36 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 38 | @echo " text to make text files" 39 | @echo " man to make manual pages" 40 | @echo " texinfo to make Texinfo files" 41 | @echo " info to make Texinfo files and run them through makeinfo" 42 | @echo " gettext to make PO message catalogs" 43 | @echo " changes to make an overview of all changed/added/deprecated items" 44 | @echo " xml to make Docutils-native XML files" 45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 46 | @echo " linkcheck to check all external links for integrity" 47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 48 | @echo " coverage to run coverage check of the documentation (if enabled)" 49 | 50 | .PHONY: clean 51 | clean: 52 | rm -rf $(BUILDDIR)/* 53 | 54 | .PHONY: html 55 | html: 56 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 57 | @echo 58 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 59 | 60 | .PHONY: dirhtml 61 | dirhtml: 62 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 63 | @echo 64 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 65 | 66 | .PHONY: singlehtml 67 | singlehtml: 68 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 69 | @echo 70 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 71 | 72 | .PHONY: pickle 73 | pickle: 74 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 75 | @echo 76 | @echo "Build finished; now you can process the pickle files." 77 | 78 | .PHONY: json 79 | json: 80 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 81 | @echo 82 | @echo "Build finished; now you can process the JSON files." 83 | 84 | .PHONY: htmlhelp 85 | htmlhelp: 86 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 87 | @echo 88 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 89 | ".hhp project file in $(BUILDDIR)/htmlhelp." 90 | 91 | .PHONY: qthelp 92 | qthelp: 93 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 94 | @echo 95 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 96 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 97 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/dota2.qhcp" 98 | @echo "To view the help file:" 99 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/dota2.qhc" 100 | 101 | .PHONY: applehelp 102 | applehelp: 103 | $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp 104 | @echo 105 | @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." 106 | @echo "N.B. You won't be able to view it unless you put it in" \ 107 | "~/Library/Documentation/Help or install it in your application" \ 108 | "bundle." 109 | 110 | .PHONY: devhelp 111 | devhelp: 112 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 113 | @echo 114 | @echo "Build finished." 115 | @echo "To view the help file:" 116 | @echo "# mkdir -p $$HOME/.local/share/devhelp/dota2" 117 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/dota2" 118 | @echo "# devhelp" 119 | 120 | .PHONY: epub 121 | epub: 122 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 123 | @echo 124 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 125 | 126 | .PHONY: latex 127 | latex: 128 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 129 | @echo 130 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 131 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 132 | "(use \`make latexpdf' here to do that automatically)." 133 | 134 | .PHONY: latexpdf 135 | latexpdf: 136 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 137 | @echo "Running LaTeX files through pdflatex..." 138 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 139 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 140 | 141 | .PHONY: latexpdfja 142 | latexpdfja: 143 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 144 | @echo "Running LaTeX files through platex and dvipdfmx..." 145 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 146 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 147 | 148 | .PHONY: text 149 | text: 150 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 151 | @echo 152 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 153 | 154 | .PHONY: man 155 | man: 156 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 157 | @echo 158 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 159 | 160 | .PHONY: texinfo 161 | texinfo: 162 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 163 | @echo 164 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 165 | @echo "Run \`make' in that directory to run these through makeinfo" \ 166 | "(use \`make info' here to do that automatically)." 167 | 168 | .PHONY: info 169 | info: 170 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 171 | @echo "Running Texinfo files through makeinfo..." 172 | make -C $(BUILDDIR)/texinfo info 173 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 174 | 175 | .PHONY: gettext 176 | gettext: 177 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 178 | @echo 179 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 180 | 181 | .PHONY: changes 182 | changes: 183 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 184 | @echo 185 | @echo "The overview file is in $(BUILDDIR)/changes." 186 | 187 | .PHONY: linkcheck 188 | linkcheck: 189 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 190 | @echo 191 | @echo "Link check complete; look for any errors in the above output " \ 192 | "or in $(BUILDDIR)/linkcheck/output.txt." 193 | 194 | .PHONY: doctest 195 | doctest: 196 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 197 | @echo "Testing of doctests in the sources finished, look at the " \ 198 | "results in $(BUILDDIR)/doctest/output.txt." 199 | 200 | .PHONY: coverage 201 | coverage: 202 | $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage 203 | @echo "Testing of coverage in the sources finished, look at the " \ 204 | "results in $(BUILDDIR)/coverage/python.txt." 205 | 206 | .PHONY: xml 207 | xml: 208 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 209 | @echo 210 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 211 | 212 | .PHONY: pseudoxml 213 | pseudoxml: 214 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 215 | @echo 216 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 217 | -------------------------------------------------------------------------------- /protobufs/econ_gcmessages.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package csgo; 3 | import "steammessages.proto"; 4 | 5 | option optimize_for = SPEED; 6 | option py_generic_services = false; 7 | 8 | enum EGCItemMsg { 9 | k_EMsgGCBase = 1000; 10 | k_EMsgGCSetItemPosition = 1001; 11 | k_EMsgGCCraft = 1002; 12 | k_EMsgGCCraftResponse = 1003; 13 | k_EMsgGCDelete = 1004; 14 | k_EMsgGCVerifyCacheSubscription = 1005; 15 | k_EMsgGCNameItem = 1006; 16 | k_EMsgGCUnlockCrate = 1007; 17 | k_EMsgGCUnlockCrateResponse = 1008; 18 | k_EMsgGCPaintItem = 1009; 19 | k_EMsgGCPaintItemResponse = 1010; 20 | k_EMsgGCGoldenWrenchBroadcast = 1011; 21 | k_EMsgGCMOTDRequest = 1012; 22 | k_EMsgGCMOTDRequestResponse = 1013; 23 | k_EMsgGCAddItemToSocket_DEPRECATED = 1014; 24 | k_EMsgGCAddItemToSocketResponse_DEPRECATED = 1015; 25 | k_EMsgGCAddSocketToBaseItem_DEPRECATED = 1016; 26 | k_EMsgGCAddSocketToItem_DEPRECATED = 1017; 27 | k_EMsgGCAddSocketToItemResponse_DEPRECATED = 1018; 28 | k_EMsgGCNameBaseItem = 1019; 29 | k_EMsgGCNameBaseItemResponse = 1020; 30 | k_EMsgGCRemoveSocketItem_DEPRECATED = 1021; 31 | k_EMsgGCRemoveSocketItemResponse_DEPRECATED = 1022; 32 | k_EMsgGCCustomizeItemTexture = 1023; 33 | k_EMsgGCCustomizeItemTextureResponse = 1024; 34 | k_EMsgGCUseItemRequest = 1025; 35 | k_EMsgGCUseItemResponse = 1026; 36 | k_EMsgGCGiftedItems_DEPRECATED = 1027; 37 | k_EMsgGCRemoveItemName = 1030; 38 | k_EMsgGCRemoveItemPaint = 1031; 39 | k_EMsgGCGiftWrapItem = 1032; 40 | k_EMsgGCGiftWrapItemResponse = 1033; 41 | k_EMsgGCDeliverGift = 1034; 42 | k_EMsgGCDeliverGiftResponseGiver = 1035; 43 | k_EMsgGCDeliverGiftResponseReceiver = 1036; 44 | k_EMsgGCUnwrapGiftRequest = 1037; 45 | k_EMsgGCUnwrapGiftResponse = 1038; 46 | k_EMsgGCSetItemStyle = 1039; 47 | k_EMsgGCUsedClaimCodeItem = 1040; 48 | k_EMsgGCSortItems = 1041; 49 | k_EMsgGC_RevolvingLootList_DEPRECATED = 1042; 50 | k_EMsgGCLookupAccount = 1043; 51 | k_EMsgGCLookupAccountResponse = 1044; 52 | k_EMsgGCLookupAccountName = 1045; 53 | k_EMsgGCLookupAccountNameResponse = 1046; 54 | k_EMsgGCUpdateItemSchema = 1049; 55 | k_EMsgGCRemoveCustomTexture = 1051; 56 | k_EMsgGCRemoveCustomTextureResponse = 1052; 57 | k_EMsgGCRemoveMakersMark = 1053; 58 | k_EMsgGCRemoveMakersMarkResponse = 1054; 59 | k_EMsgGCRemoveUniqueCraftIndex = 1055; 60 | k_EMsgGCRemoveUniqueCraftIndexResponse = 1056; 61 | k_EMsgGCSaxxyBroadcast = 1057; 62 | k_EMsgGCBackpackSortFinished = 1058; 63 | k_EMsgGCAdjustItemEquippedState = 1059; 64 | k_EMsgGCCollectItem = 1061; 65 | k_EMsgGCItemAcknowledged__DEPRECATED = 1062; 66 | k_EMsgGC_ReportAbuse = 1065; 67 | k_EMsgGC_ReportAbuseResponse = 1066; 68 | k_EMsgGCNameItemNotification = 1068; 69 | k_EMsgGCApplyConsumableEffects = 1069; 70 | k_EMsgGCConsumableExhausted = 1070; 71 | k_EMsgGCShowItemsPickedUp = 1071; 72 | k_EMsgGCClientDisplayNotification = 1072; 73 | k_EMsgGCApplyStrangePart = 1073; 74 | k_EMsgGC_IncrementKillCountAttribute = 1074; 75 | k_EMsgGC_IncrementKillCountResponse = 1075; 76 | k_EMsgGCApplyPennantUpgrade = 1076; 77 | k_EMsgGCSetItemPositions = 1077; 78 | k_EMsgGCApplyEggEssence = 1078; 79 | k_EMsgGCNameEggEssenceResponse = 1079; 80 | k_EMsgGCPaintKitItem = 1080; 81 | k_EMsgGCPaintKitBaseItem = 1081; 82 | k_EMsgGCPaintKitItemResponse = 1082; 83 | k_EMsgGCGiftedItems = 1083; 84 | k_EMsgGCUnlockItemStyle = 1084; 85 | k_EMsgGCUnlockItemStyleResponse = 1085; 86 | k_EMsgGCApplySticker = 1086; 87 | k_EMsgGCItemAcknowledged = 1087; 88 | k_EMsgGCStatTrakSwap = 1088; 89 | k_EMsgGCUserTrackTimePlayedConsecutively = 1089; 90 | k_EMsgGCItemCustomizationNotification = 1090; 91 | k_EMsgGCModifyItemAttribute = 1091; 92 | k_EMsgGCCasketItemAdd = 1092; 93 | k_EMsgGCCasketItemExtract = 1093; 94 | k_EMsgGCCasketItemLoadContents = 1094; 95 | k_EMsgGCTradingBase = 1500; 96 | k_EMsgGCTrading_InitiateTradeRequest = 1501; 97 | k_EMsgGCTrading_InitiateTradeResponse = 1502; 98 | k_EMsgGCTrading_StartSession = 1503; 99 | k_EMsgGCTrading_SetItem = 1504; 100 | k_EMsgGCTrading_RemoveItem = 1505; 101 | k_EMsgGCTrading_UpdateTradeInfo = 1506; 102 | k_EMsgGCTrading_SetReadiness = 1507; 103 | k_EMsgGCTrading_ReadinessResponse = 1508; 104 | k_EMsgGCTrading_SessionClosed = 1509; 105 | k_EMsgGCTrading_CancelSession = 1510; 106 | k_EMsgGCTrading_TradeChatMsg = 1511; 107 | k_EMsgGCTrading_ConfirmOffer = 1512; 108 | k_EMsgGCTrading_TradeTypingChatMsg = 1513; 109 | k_EMsgGCServerBrowser_FavoriteServer = 1601; 110 | k_EMsgGCServerBrowser_BlacklistServer = 1602; 111 | k_EMsgGCServerRentalsBase = 1700; 112 | k_EMsgGCItemPreviewCheckStatus = 1701; 113 | k_EMsgGCItemPreviewStatusResponse = 1702; 114 | k_EMsgGCItemPreviewRequest = 1703; 115 | k_EMsgGCItemPreviewRequestResponse = 1704; 116 | k_EMsgGCItemPreviewExpire = 1705; 117 | k_EMsgGCItemPreviewExpireNotification = 1706; 118 | k_EMsgGCItemPreviewItemBoughtNotification = 1707; 119 | k_EMsgGCDev_NewItemRequest = 2001; 120 | k_EMsgGCDev_NewItemRequestResponse = 2002; 121 | k_EMsgGCDev_PaintKitDropItem = 2003; 122 | k_EMsgGCStoreGetUserData = 2500; 123 | k_EMsgGCStoreGetUserDataResponse = 2501; 124 | k_EMsgGCStorePurchaseInit_DEPRECATED = 2502; 125 | k_EMsgGCStorePurchaseInitResponse_DEPRECATED = 2503; 126 | k_EMsgGCStorePurchaseFinalize = 2504; 127 | k_EMsgGCStorePurchaseFinalizeResponse = 2505; 128 | k_EMsgGCStorePurchaseCancel = 2506; 129 | k_EMsgGCStorePurchaseCancelResponse = 2507; 130 | k_EMsgGCStorePurchaseQueryTxn = 2508; 131 | k_EMsgGCStorePurchaseQueryTxnResponse = 2509; 132 | k_EMsgGCStorePurchaseInit = 2510; 133 | k_EMsgGCStorePurchaseInitResponse = 2511; 134 | k_EMsgGCBannedWordListRequest = 2512; 135 | k_EMsgGCBannedWordListResponse = 2513; 136 | k_EMsgGCToGCBannedWordListBroadcast = 2514; 137 | k_EMsgGCToGCBannedWordListUpdated = 2515; 138 | k_EMsgGCToGCDirtySDOCache = 2516; 139 | k_EMsgGCToGCDirtyMultipleSDOCache = 2517; 140 | k_EMsgGCToGCUpdateSQLKeyValue = 2518; 141 | k_EMsgGCToGCIsTrustedServer = 2519; 142 | k_EMsgGCToGCIsTrustedServerResponse = 2520; 143 | k_EMsgGCToGCBroadcastConsoleCommand = 2521; 144 | k_EMsgGCServerVersionUpdated = 2522; 145 | k_EMsgGCApplyAutograph = 2523; 146 | k_EMsgGCToGCWebAPIAccountChanged = 2524; 147 | k_EMsgGCRequestAnnouncements = 2525; 148 | k_EMsgGCRequestAnnouncementsResponse = 2526; 149 | k_EMsgGCRequestPassportItemGrant = 2527; 150 | k_EMsgGCClientVersionUpdated = 2528; 151 | k_EMsgGCAdjustItemEquippedStateMulti = 2529; 152 | } 153 | 154 | enum EGCMsgResponse { 155 | k_EGCMsgResponseOK = 0; 156 | k_EGCMsgResponseDenied = 1; 157 | k_EGCMsgResponseServerError = 2; 158 | k_EGCMsgResponseTimeout = 3; 159 | k_EGCMsgResponseInvalid = 4; 160 | k_EGCMsgResponseNoMatch = 5; 161 | k_EGCMsgResponseUnknownError = 6; 162 | k_EGCMsgResponseNotLoggedOn = 7; 163 | k_EGCMsgFailedToCreate = 8; 164 | k_EGCMsgLimitExceeded = 9; 165 | k_EGCMsgCommitUnfinalized = 10; 166 | } 167 | 168 | enum EUnlockStyle { 169 | k_UnlockStyle_Succeeded = 0; 170 | k_UnlockStyle_Failed_PreReq = 1; 171 | k_UnlockStyle_Failed_CantAfford = 2; 172 | k_UnlockStyle_Failed_CantCommit = 3; 173 | k_UnlockStyle_Failed_CantLockCache = 4; 174 | k_UnlockStyle_Failed_CantAffordAttrib = 5; 175 | } 176 | 177 | enum EGCItemCustomizationNotification { 178 | k_EGCItemCustomizationNotification_NameItem = 1006; 179 | k_EGCItemCustomizationNotification_UnlockCrate = 1007; 180 | k_EGCItemCustomizationNotification_XRayItemReveal = 1008; 181 | k_EGCItemCustomizationNotification_XRayItemClaim = 1009; 182 | k_EGCItemCustomizationNotification_CasketTooFull = 1011; 183 | k_EGCItemCustomizationNotification_CasketContents = 1012; 184 | k_EGCItemCustomizationNotification_CasketAdded = 1013; 185 | k_EGCItemCustomizationNotification_CasketRemoved = 1014; 186 | k_EGCItemCustomizationNotification_CasketInvFull = 1015; 187 | k_EGCItemCustomizationNotification_NameBaseItem = 1019; 188 | k_EGCItemCustomizationNotification_RemoveItemName = 1030; 189 | k_EGCItemCustomizationNotification_RemoveSticker = 1053; 190 | k_EGCItemCustomizationNotification_ApplySticker = 1086; 191 | k_EGCItemCustomizationNotification_StatTrakSwap = 1088; 192 | k_EGCItemCustomizationNotification_RemovePatch = 1089; 193 | k_EGCItemCustomizationNotification_ApplyPatch = 1090; 194 | k_EGCItemCustomizationNotification_ActivateFanToken = 9178; 195 | k_EGCItemCustomizationNotification_ActivateOperationCoin = 9179; 196 | k_EGCItemCustomizationNotification_GraffitiUnseal = 9185; 197 | k_EGCItemCustomizationNotification_GenerateSouvenir = 9204; 198 | k_EGCItemCustomizationNotification_ClientRedeemMissionReward = 9209; 199 | } 200 | 201 | message CMsgGCGiftedItems { 202 | optional uint32 accountid = 1; 203 | optional uint32 giftdefindex = 2; 204 | optional uint32 max_gifts_possible = 3; 205 | optional uint32 num_eligible_recipients = 4; 206 | repeated uint32 recipients_accountids = 5; 207 | } 208 | 209 | message CMsgApplyAutograph { 210 | optional uint64 autograph_item_id = 1; 211 | optional uint64 item_item_id = 2; 212 | } 213 | 214 | message CMsgCasketItem { 215 | optional uint64 casket_item_id = 1; 216 | optional uint64 item_item_id = 2; 217 | } 218 | 219 | message CMsgGCUserTrackTimePlayedConsecutively { 220 | optional uint32 state = 1; 221 | } 222 | 223 | message CMsgGCItemCustomizationNotification { 224 | repeated uint64 item_id = 1; 225 | optional uint32 request = 2; 226 | } 227 | -------------------------------------------------------------------------------- /protobufs/gcsdk_gcmessages.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package csgo; 3 | import "steammessages.proto"; 4 | 5 | option optimize_for = SPEED; 6 | option py_generic_services = false; 7 | 8 | enum GCClientLauncherType { 9 | GCClientLauncherType_DEFAULT = 0; 10 | GCClientLauncherType_PERFECTWORLD = 1; 11 | GCClientLauncherType_STEAMCHINA = 2; 12 | } 13 | 14 | enum GCConnectionStatus { 15 | GCConnectionStatus_HAVE_SESSION = 0; 16 | GCConnectionStatus_GC_GOING_DOWN = 1; 17 | GCConnectionStatus_NO_SESSION = 2; 18 | GCConnectionStatus_NO_SESSION_IN_LOGON_QUEUE = 3; 19 | GCConnectionStatus_NO_STEAM = 4; 20 | } 21 | 22 | message CMsgSOIDOwner { 23 | optional uint32 type = 1; 24 | optional uint64 id = 2; 25 | } 26 | 27 | message CMsgSOSingleObject { 28 | optional int32 type_id = 2; 29 | optional bytes object_data = 3; 30 | optional fixed64 version = 4; 31 | optional csgo.CMsgSOIDOwner owner_soid = 5; 32 | } 33 | 34 | message CMsgSOMultipleObjects { 35 | message SingleObject { 36 | option (msgpool_soft_limit) = 256; 37 | option (msgpool_hard_limit) = 1024; 38 | 39 | optional int32 type_id = 1; 40 | optional bytes object_data = 2; 41 | } 42 | 43 | repeated csgo.CMsgSOMultipleObjects.SingleObject objects_modified = 2; 44 | optional fixed64 version = 3; 45 | optional csgo.CMsgSOIDOwner owner_soid = 6; 46 | } 47 | 48 | message CMsgSOCacheSubscribed { 49 | message SubscribedType { 50 | optional int32 type_id = 1; 51 | repeated bytes object_data = 2; 52 | } 53 | 54 | repeated csgo.CMsgSOCacheSubscribed.SubscribedType objects = 2; 55 | optional fixed64 version = 3; 56 | optional csgo.CMsgSOIDOwner owner_soid = 4; 57 | } 58 | 59 | message CMsgSOCacheUnsubscribed { 60 | optional csgo.CMsgSOIDOwner owner_soid = 2; 61 | } 62 | 63 | message CMsgSOCacheSubscriptionCheck { 64 | optional fixed64 version = 2; 65 | optional csgo.CMsgSOIDOwner owner_soid = 3; 66 | } 67 | 68 | message CMsgSOCacheSubscriptionRefresh { 69 | optional csgo.CMsgSOIDOwner owner_soid = 2; 70 | } 71 | 72 | message CMsgSOCacheVersion { 73 | optional fixed64 version = 1; 74 | } 75 | 76 | message CMsgAccountDetails { 77 | optional bool valid = 1; 78 | optional string account_name = 2; 79 | optional bool public_profile = 4; 80 | optional bool public_inventory = 5; 81 | optional bool vac_banned = 6; 82 | optional bool cyber_cafe = 7; 83 | optional bool school_account = 8; 84 | optional bool free_trial_account = 9; 85 | optional bool subscribed = 10; 86 | optional bool low_violence = 11; 87 | optional bool limited = 12; 88 | optional bool trusted = 13; 89 | optional uint32 package = 14; 90 | optional fixed32 time_cached = 15; 91 | optional bool account_locked = 16; 92 | optional bool community_banned = 17; 93 | optional bool trade_banned = 18; 94 | optional bool eligible_for_community_market = 19; 95 | } 96 | 97 | message CMsgGCMultiplexMessage { 98 | optional uint32 msgtype = 1; 99 | optional bytes payload = 2; 100 | repeated fixed64 steamids = 3; 101 | optional bool replytogc = 4; 102 | } 103 | 104 | message CMsgGCMultiplexMessage_Response { 105 | optional uint32 msgtype = 1; 106 | } 107 | 108 | message CGCToGCMsgMasterAck { 109 | optional uint32 dir_index = 1; 110 | optional uint32 gc_type = 2; 111 | } 112 | 113 | message CGCToGCMsgMasterAck_Response { 114 | optional int32 eresult = 1 [default = 2]; 115 | } 116 | 117 | message CGCToGCMsgMasterStartupComplete { 118 | } 119 | 120 | message CGCToGCMsgRouted { 121 | optional uint32 msg_type = 1; 122 | optional fixed64 sender_id = 2; 123 | optional bytes net_message = 3; 124 | optional uint32 ip = 4; 125 | } 126 | 127 | message CGCToGCMsgRoutedReply { 128 | optional uint32 msg_type = 1; 129 | optional bytes net_message = 2; 130 | } 131 | 132 | message CMsgGCUpdateSessionIP { 133 | optional fixed64 steamid = 1; 134 | optional fixed32 ip = 2; 135 | } 136 | 137 | message CMsgGCRequestSessionIP { 138 | optional fixed64 steamid = 1; 139 | } 140 | 141 | message CMsgGCRequestSessionIPResponse { 142 | optional fixed32 ip = 1; 143 | } 144 | 145 | message CMsgSOCacheHaveVersion { 146 | optional csgo.CMsgSOIDOwner soid = 1; 147 | optional fixed64 version = 2; 148 | } 149 | 150 | message CMsgClientHello { 151 | optional uint32 version = 1; 152 | repeated csgo.CMsgSOCacheHaveVersion socache_have_versions = 2; 153 | optional uint32 client_session_need = 3; 154 | optional uint32 client_launcher = 4; 155 | optional uint32 partner_srcid = 5; 156 | optional uint32 partner_accountid = 6; 157 | optional uint32 partner_accountflags = 7; 158 | optional uint32 partner_accountbalance = 8; 159 | optional uint32 steam_launcher = 9; 160 | } 161 | 162 | message CMsgServerHello { 163 | optional uint32 version = 1; 164 | repeated csgo.CMsgSOCacheHaveVersion socache_have_versions = 2; 165 | optional uint32 legacy_client_session_need = 3; 166 | optional uint32 client_launcher = 4; 167 | optional bytes legacy_steamdatagram_routing = 6; 168 | optional uint32 required_internal_addr = 7; 169 | optional bytes steamdatagram_login = 8; 170 | } 171 | 172 | message CMsgClientWelcome { 173 | message Location { 174 | optional float latitude = 1; 175 | optional float longitude = 2; 176 | optional string country = 3; 177 | } 178 | 179 | optional uint32 version = 1; 180 | optional bytes game_data = 2; 181 | repeated csgo.CMsgSOCacheSubscribed outofdate_subscribed_caches = 3; 182 | repeated csgo.CMsgSOCacheSubscriptionCheck uptodate_subscribed_caches = 4; 183 | optional csgo.CMsgClientWelcome.Location location = 5; 184 | optional bytes game_data2 = 6; 185 | optional uint32 rtime32_gc_welcome_timestamp = 7; 186 | optional uint32 currency = 8; 187 | optional uint32 balance = 9; 188 | optional string balance_url = 10; 189 | optional string txn_country_code = 11; 190 | } 191 | 192 | message CMsgConnectionStatus { 193 | optional csgo.GCConnectionStatus status = 1 [default = GCConnectionStatus_HAVE_SESSION]; 194 | optional uint32 client_session_need = 2; 195 | optional int32 queue_position = 3; 196 | optional int32 queue_size = 4; 197 | optional int32 wait_seconds = 5; 198 | optional int32 estimated_wait_seconds_remaining = 6; 199 | } 200 | 201 | message CWorkshop_PopulateItemDescriptions_Request { 202 | message SingleItemDescription { 203 | optional uint32 gameitemid = 1; 204 | optional string item_description = 2; 205 | optional bool one_per_account = 3; 206 | } 207 | 208 | message ItemDescriptionsLanguageBlock { 209 | optional string language = 1; 210 | repeated csgo.CWorkshop_PopulateItemDescriptions_Request.SingleItemDescription descriptions = 2; 211 | } 212 | 213 | optional uint32 appid = 1; 214 | repeated csgo.CWorkshop_PopulateItemDescriptions_Request.ItemDescriptionsLanguageBlock languages = 2; 215 | } 216 | 217 | message CWorkshop_GetContributors_Request { 218 | optional uint32 appid = 1; 219 | optional uint32 gameitemid = 2; 220 | } 221 | 222 | message CWorkshop_GetContributors_Response { 223 | repeated fixed64 contributors = 1; 224 | } 225 | 226 | message CWorkshop_SetItemPaymentRules_Request { 227 | message WorkshopItemPaymentRule { 228 | optional uint64 workshop_file_id = 1; 229 | optional float revenue_percentage = 2; 230 | optional string rule_description = 3; 231 | optional uint32 rule_type = 4 [default = 1]; 232 | } 233 | 234 | message WorkshopDirectPaymentRule { 235 | optional uint64 workshop_file_id = 1; 236 | optional string rule_description = 2; 237 | } 238 | 239 | message PartnerItemPaymentRule { 240 | optional uint32 account_id = 1; 241 | optional float revenue_percentage = 2; 242 | optional string rule_description = 3; 243 | } 244 | 245 | optional uint32 appid = 1; 246 | optional uint32 gameitemid = 2; 247 | repeated csgo.CWorkshop_SetItemPaymentRules_Request.WorkshopItemPaymentRule associated_workshop_files = 3; 248 | repeated csgo.CWorkshop_SetItemPaymentRules_Request.PartnerItemPaymentRule partner_accounts = 4; 249 | optional bool validate_only = 5; 250 | optional bool make_workshop_files_subscribable = 6; 251 | optional csgo.CWorkshop_SetItemPaymentRules_Request.WorkshopDirectPaymentRule associated_workshop_file_for_direct_payments = 7; 252 | } 253 | 254 | message CWorkshop_SetItemPaymentRules_Response { 255 | } 256 | 257 | message CGameServers_AggregationQuery_Request { 258 | optional string filter = 1; 259 | repeated string group_fields = 3; 260 | } 261 | 262 | message CGameServers_AggregationQuery_Response { 263 | message Group { 264 | repeated string group_values = 1; 265 | optional uint32 servers_empty = 2; 266 | optional uint32 servers_full = 3; 267 | optional uint32 servers_total = 4; 268 | optional uint32 players_humans = 5; 269 | optional uint32 players_bots = 6; 270 | optional uint32 player_capacity = 7; 271 | } 272 | 273 | repeated csgo.CGameServers_AggregationQuery_Response.Group groups = 1; 274 | } 275 | 276 | message CWorkshop_AddSpecialPayment_Request { 277 | optional uint32 appid = 1; 278 | optional uint32 gameitemid = 2; 279 | optional string date = 3; 280 | optional uint64 payment_us_usd = 4; 281 | optional uint64 payment_row_usd = 5; 282 | } 283 | 284 | message CWorkshop_AddSpecialPayment_Response { 285 | } 286 | 287 | message CProductInfo_SetRichPresenceLocalization_Request { 288 | message Token { 289 | optional string token = 1; 290 | optional string value = 2; 291 | } 292 | 293 | message LanguageSection { 294 | optional string language = 1; 295 | repeated csgo.CProductInfo_SetRichPresenceLocalization_Request.Token tokens = 2; 296 | } 297 | 298 | optional uint32 appid = 1; 299 | repeated csgo.CProductInfo_SetRichPresenceLocalization_Request.LanguageSection languages = 2; 300 | optional uint64 steamid = 3; 301 | } 302 | 303 | message CProductInfo_SetRichPresenceLocalization_Response { 304 | } 305 | -------------------------------------------------------------------------------- /csgo/client.py: -------------------------------------------------------------------------------- 1 | """ 2 | Only the most essential features to :class:`csgo.client.CSGOClient` are found here. Every other feature is inherited from 3 | the :mod:`csgo.features` package and it's submodules. 4 | """ 5 | 6 | import logging 7 | import gevent 8 | import google.protobuf 9 | from steam.core.msg import GCMsgHdrProto 10 | from steam.client.gc import GameCoordinator 11 | from steam.enums.emsg import EMsg 12 | from steam.utils.proto import proto_fill_from_dict 13 | from csgo.features import FeatureBase 14 | from csgo.enums import EGCBaseClientMsg, GCConnectionStatus, GCClientLauncherType 15 | from csgo.msg import get_emsg_enum, find_proto 16 | from csgo.protobufs import gcsdk_gcmessages_pb2 as pb_gc 17 | from csgo.protobufs import cstrike15_gcmessages_pb2 as pb_gclient 18 | 19 | 20 | class CSGOClient(GameCoordinator, FeatureBase): 21 | """ 22 | :param steam_client: Instance of the steam client 23 | :type steam_client: :class:`steam.client.SteamClient` 24 | """ 25 | _retry_welcome_loop = None 26 | verbose_debug = False 27 | #: enable pretty print of messages in debug logging 28 | app_id = 730 29 | #: main client app id 30 | launcher = GCClientLauncherType.DEFAULT 31 | #: launcher type (used for access to PW) See: :class:`csgo.enums.GCClientLauncherType` 32 | current_jobid = 0 33 | ready = False 34 | #: ``True`` when we have a session with GC 35 | connection_status = GCConnectionStatus.NO_SESSION 36 | #: See :class:`csgo.enums.GCConnectionStatus` 37 | 38 | @property 39 | def account_id(self): 40 | """ 41 | Account ID of the logged-in user in the steam client 42 | """ 43 | return self.steam.steam_id.id 44 | 45 | @property 46 | def steam_id(self): 47 | """ 48 | :class:`steam.steamid.SteamID` of the logged-in user in the steam client 49 | """ 50 | return self.steam.steam_id 51 | 52 | def __init__(self, steam_client): 53 | GameCoordinator.__init__(self, steam_client, self.app_id) 54 | self._LOG = logging.getLogger(self.__class__.__name__) 55 | 56 | FeatureBase.__init__(self) 57 | 58 | self.steam.on('disconnected', self._handle_disconnect) 59 | self.steam.on(EMsg.ClientPlayingSessionState, self._handle_play_sess_state) 60 | 61 | # register GC message handles 62 | self.on(EGCBaseClientMsg.EMsgGCClientConnectionStatus, self._handle_conn_status) 63 | self.on(EGCBaseClientMsg.EMsgGCClientWelcome, self._handle_client_welcome) 64 | 65 | def __repr__(self): 66 | return "<%s(%s) %s>" % (self.__class__.__name__, 67 | repr(self.steam), 68 | repr(self.connection_status), 69 | ) 70 | 71 | def _handle_play_sess_state(self, message): 72 | if self.ready and message.playing_app != self.app_id: 73 | self._set_connection_status(GCConnectionStatus.NO_SESSION) 74 | 75 | def _handle_disconnect(self): 76 | if self._retry_welcome_loop: 77 | self._retry_welcome_loop.kill() 78 | 79 | self._set_connection_status(GCConnectionStatus.NO_SESSION) 80 | 81 | def _handle_client_welcome(self, message): 82 | self._set_connection_status(GCConnectionStatus.HAVE_SESSION) 83 | 84 | # handle CSGO Welcome 85 | submessage = pb_gclient.CMsgCStrike15Welcome() 86 | submessage.ParseFromString(message.game_data) 87 | 88 | if self.verbose_debug: 89 | self._LOG.debug("Got CStrike15Welcome:\n%s" % str(submessage)) 90 | else: 91 | self._LOG.debug("Got CStrike15Welcome") 92 | 93 | self.emit('csgo_welcome', submessage) 94 | 95 | def _handle_conn_status(self, message): 96 | self._set_connection_status(message.status) 97 | 98 | def _process_gc_message(self, emsg, header, payload): 99 | emsg = get_emsg_enum(emsg) 100 | proto = find_proto(emsg) 101 | 102 | if proto is None: 103 | self._LOG.error("Failed to parse: %s" % repr(emsg)) 104 | return 105 | 106 | message = proto() 107 | message.ParseFromString(payload) 108 | 109 | if self.verbose_debug: 110 | self._LOG.debug("Incoming: %s\n%s\n---------\n%s" % (repr(emsg), 111 | str(header), 112 | str(message), 113 | )) 114 | else: 115 | self._LOG.debug("Incoming: %s", repr(emsg)) 116 | 117 | self.emit(emsg, message) 118 | 119 | if header.proto.job_id_target != 18446744073709551615: 120 | self.emit('job_%d' % header.proto.job_id_target, message) 121 | 122 | def _set_connection_status(self, status): 123 | prev_status = self.connection_status 124 | self.connection_status = GCConnectionStatus(status) 125 | 126 | if self.connection_status != prev_status: 127 | self.emit("connection_status", self.connection_status) 128 | 129 | if self.connection_status == GCConnectionStatus.HAVE_SESSION and not self.ready: 130 | self.ready = True 131 | self.emit('ready') 132 | elif self.connection_status != GCConnectionStatus.HAVE_SESSION and self.ready: 133 | self.ready = False 134 | self.emit('notready') 135 | 136 | def wait_msg(self, event, timeout=None, raises=None): 137 | """Wait for a message, similiar to :meth:`.wait_event` 138 | 139 | :param event: event id 140 | :type event: :class:`.ECsgoGCMsg` or job id 141 | :param timeout: seconds to wait before timeout 142 | :type timeout: :class:`int` 143 | :param raises: On timeout when ``False`` returns :class:`None`, else raise :class:`gevent.Timeout` 144 | :type raises: :class:`bool` 145 | :return: returns a message or :class:`None` 146 | :rtype: :class:`None`, or `proto message` 147 | :raises: :class:`gevent.Timeout` 148 | """ 149 | resp = self.wait_event(event, timeout, raises) 150 | 151 | if resp is not None: 152 | return resp[0] 153 | 154 | def send_job(self, *args, **kwargs): 155 | """ 156 | Send a message as a job 157 | 158 | Exactly the same as :meth:`send` 159 | 160 | :return: jobid event identifier 161 | :rtype: :class:`str` 162 | 163 | """ 164 | jobid = self.current_jobid = ((self.current_jobid + 1) % 10000) or 1 165 | self.remove_all_listeners('job_%d' % jobid) 166 | 167 | self._send(*args, jobid=jobid, **kwargs) 168 | 169 | return "job_%d" % jobid 170 | 171 | def send(self, emsg, data={}, proto=None): 172 | """ 173 | Send a message 174 | 175 | :param emsg: Enum for the message 176 | :param data: data for the proto message 177 | :type data: :class:`dict` 178 | :param proto: (optional) manually specify protobuf, other it's detected based on ``emsg`` 179 | """ 180 | self._send(emsg, data, proto) 181 | 182 | def _send(self, emsg, data={}, proto=None, jobid=None): 183 | if not isinstance(data, dict): 184 | raise ValueError("data kwarg can only be a dict") 185 | 186 | if proto is None: 187 | proto = find_proto(emsg) 188 | 189 | if proto is None or not issubclass(proto, google.protobuf.message.Message): 190 | raise ValueError("Unable to find proto for emsg, or proto kwarg is invalid") 191 | 192 | message = proto() 193 | proto_fill_from_dict(message, data) 194 | 195 | header = GCMsgHdrProto(emsg) 196 | 197 | if jobid is not None: 198 | header.proto.job_id_source = jobid 199 | 200 | if self.verbose_debug: 201 | str_message = '' 202 | str_header = str(header) 203 | str_body = str(message) 204 | 205 | if str_header: 206 | str_message += "-- header ---------\n%s\n" % str_header 207 | if str_body: 208 | str_message += "-- message --------\n%s\n" % str_body 209 | 210 | self._LOG.debug("Outgoing: %s\n%s" % (repr(emsg), str_message)) 211 | else: 212 | self._LOG.debug("Outgoing: %s", repr(emsg)) 213 | 214 | GameCoordinator.send(self, header, message.SerializeToString()) 215 | 216 | def _knock_on_gc(self): 217 | n = 1 218 | 219 | while True: 220 | if not self.ready: 221 | if self.launcher == GCClientLauncherType.PERFECTWORLD: 222 | self.send(EGCBaseClientMsg.EMsgGCClientHelloPW, { 223 | 'client_launcher': self.launcher, 224 | }) 225 | else: # GCClientLauncherType.DEFAULT 226 | self.send(EGCBaseClientMsg.EMsgGCClientHello) 227 | 228 | self.wait_event('ready', timeout=3 + (2**n)) 229 | n = min(n + 1, 4) 230 | 231 | else: 232 | self.wait_event('notready') 233 | n = 1 234 | gevent.sleep(1) 235 | 236 | def launch(self): 237 | """ 238 | Launch CSGO and establish connection with the game coordinator 239 | 240 | ``ready`` event will fire when the session is ready. 241 | If the session is lost ``notready`` event will fire. 242 | Alternatively, ``connection_status`` event can be monitored for changes. 243 | """ 244 | if not self.steam.logged_on: 245 | self.steam.wait_event('logged_on') 246 | 247 | if not self._retry_welcome_loop and self.app_id not in self.steam.current_games_played: 248 | self.steam.games_played(self.steam.current_games_played + [self.app_id]) 249 | self._retry_welcome_loop = gevent.spawn(self._knock_on_gc) 250 | 251 | def exit(self): 252 | """ 253 | Close connection to CSGO's game coordinator 254 | """ 255 | if self._retry_welcome_loop: 256 | self._retry_welcome_loop.kill() 257 | 258 | if self.app_id in self.steam.current_games_played: 259 | self.steam.current_games_played.remove(self.app_id) 260 | self.steam.games_played(self.steam.current_games_played) 261 | 262 | self._set_connection_status(GCConnectionStatus.NO_SESSION) 263 | -------------------------------------------------------------------------------- /csgo/features/sharedobjects.py: -------------------------------------------------------------------------------- 1 | """Essentially a :class:`dict` containing shared object caches. 2 | The objects are read-only, so don't change any values. 3 | The instance reference of individual objects will remain the same thought their lifetime. 4 | Individual objects can be accessed via their key, if they have one. 5 | 6 | .. note:: 7 | Some cache types don't have a key and only hold one object instance. 8 | Then only the the cache type is needed to access it. 9 | (e.g. ``CSOEconGameAccountClient``) 10 | 11 | .. code:: python 12 | 13 | csgo_client.socache[ESOType.CSOEconItem] # dict with item objects, key = item id 14 | csgo_client.socache[ESOType.CSOEconItem][123456] # item object 15 | 16 | csgo_client.socache[ESOType.CSOEconGameAccountClient] # returns a CSOEconGameAccountClient object 17 | 18 | Events will be fired when individual objects are updated. 19 | Event key is a :class:`tuple`` in the following format: ``(event, cache_type)``. 20 | 21 | The available events are ``new``, ``updated``, and ``removed``. 22 | Each event has a single parameter, which is the object instance. 23 | Even when removed, there is object instance returned, usually only with the key field filled. 24 | 25 | .. code:: python 26 | 27 | @csgo_client.socache.on(('new', ESOType.CSOEconItem)) 28 | def got_a_new_item(obj): 29 | print "Got a new item! Yay" 30 | print obj 31 | 32 | # access the item via socache at any time 33 | print csgo_client.socache[ESOType.CSOEconItem][obj.id] 34 | 35 | """ 36 | import logging 37 | from eventemitter import EventEmitter 38 | from csgo.enums import EGCBaseClientMsg, ESOMsg, ESOType 39 | from csgo.protobufs import base_gcmessages_pb2 as _gc_base 40 | from csgo.protobufs import cstrike15_gcmessages_pb2 as _gc_cstrike 41 | 42 | 43 | def find_so_proto(type_id): 44 | """Resolves proto massage for given type_id 45 | 46 | :param type_id: SO type 47 | :type type_id: :class:`csgo.enums.ESOType` 48 | :returns: proto message or `None` 49 | """ 50 | if not isinstance(type_id, ESOType): 51 | return None 52 | 53 | proto = getattr(_gc_base, type_id.name, None) 54 | if proto is None: 55 | proto = getattr(_gc_cstrike, type_id.name, None) 56 | 57 | return proto 58 | 59 | # hack to mark certain CSO as having no key 60 | class NO_KEY: 61 | pass 62 | 63 | so_key_fields = { 64 | # _gc_base.CSOPartyInvite.DESCRIPTOR: ['group_id'], 65 | # _gc_base.CSOLobbyInvite.DESCRIPTOR: ['group_id'], 66 | # _gc_base.CSOEconItemLeagueViewPass.DESCRIPTOR: ['account_id', 'league_id'], 67 | # _gc_base.CSOEconDefaultEquippedDefinitionInstanceClient.DESCRIPTOR: ['account_id', 'class_id', 'slot_id'], 68 | _gc_base.CSOEconItem.DESCRIPTOR: ['id'], 69 | _gc_base.CSOEconGameAccountClient.DESCRIPTOR: NO_KEY, 70 | _gc_base.CSOEconItemEventTicket.DESCRIPTOR: NO_KEY, 71 | _gc_cstrike.CSOPersonaDataPublic.DESCRIPTOR: NO_KEY, 72 | # _gc_cstrike.CSOEconCoupon.DESCRIPTOR: ['entryid'], 73 | # _gc_cstrike.CSOQuestProgress.DESCRIPTOR: ['questid'], 74 | 75 | } 76 | 77 | # key is either one or a number of fields marked with option 'key_field'=true in protos 78 | def get_so_key_fields(desc): 79 | if desc in so_key_fields: 80 | return so_key_fields[desc] 81 | else: 82 | fields = [] 83 | 84 | for field in desc.fields: 85 | for odesc, value in field.GetOptions().ListFields(): 86 | if odesc.name == 'key_field' and value == True: 87 | fields.append(field.name) 88 | 89 | so_key_fields[desc] = fields 90 | return fields 91 | 92 | def get_key_for_object(obj): 93 | key = get_so_key_fields(obj.DESCRIPTOR) 94 | 95 | if key is NO_KEY: 96 | return NO_KEY 97 | elif not key: 98 | return None 99 | elif len(key) == 1: 100 | return getattr(obj, key[0]) 101 | else: 102 | return tuple(map(lambda x: getattr(obj, x), key)) 103 | 104 | 105 | class SOBase(object): 106 | def __init__(self): 107 | super(SOBase, self).__init__() 108 | 109 | #: Shared Object Caches 110 | name = "%s.socache" % self.__class__.__name__ 111 | self.socache = SOCache(self, name) 112 | 113 | 114 | class SOCache(EventEmitter, dict): 115 | ESOType = ESOType #: expose ESOType 116 | 117 | def __init__(self, csgo_client, logger_name): 118 | self._LOG = logging.getLogger(logger_name if logger_name else self.__class__.__name__) 119 | self._caches = {} 120 | self._csgo = csgo_client 121 | 122 | # register our handlers 123 | csgo_client.on(ESOMsg.Create, self._handle_create) 124 | csgo_client.on(ESOMsg.Update, self._handle_update) 125 | csgo_client.on(ESOMsg.Destroy, self._handle_destroy) 126 | csgo_client.on(ESOMsg.UpdateMultiple, self._handle_update_multiple) 127 | csgo_client.on(ESOMsg.CacheSubscribed, self._handle_cache_subscribed) 128 | csgo_client.on(ESOMsg.CacheUnsubscribed, self._handle_cache_unsubscribed) 129 | csgo_client.on(EGCBaseClientMsg.EMsgGCClientWelcome, self._handle_client_welcome) 130 | csgo_client.on('notready', self._handle_cleanup) 131 | 132 | def __hash__(self): 133 | # pretend that we are a hashable dict, lol 134 | # don't attach more than one SOCache per CSGOClient 135 | return hash((self._csgo, 42)) 136 | 137 | def __getitem__(self, key): 138 | try: 139 | key = ESOType(key) 140 | except ValueError: 141 | raise KeyError("%s" % key) 142 | if key not in self: 143 | self[key] = dict() 144 | return dict.__getitem__(self, key) 145 | 146 | def __repr__(self): 147 | return "" % repr(self._csgo) 148 | 149 | def emit(self, event, *args): 150 | if event is not None: 151 | self._LOG.debug("Emit event: %s" % repr(event)) 152 | super(SOCache, self).emit(event, *args) 153 | 154 | def _handle_cleanup(self): 155 | for v in self.values(): 156 | if isinstance(v, dict): 157 | v.clear() 158 | self.clear() 159 | self._caches.clear() 160 | 161 | def _get_proto_for_type(self, type_id): 162 | try: 163 | type_id = ESOType(type_id) 164 | except ValueError: 165 | self._LOG.error("Unsupported type: %d" % type_id) 166 | return 167 | 168 | proto = find_so_proto(type_id) 169 | 170 | if proto is None: 171 | self._LOG.error("Unable to locate proto for: %s" % repr(type_id)) 172 | return 173 | 174 | return proto 175 | 176 | def _parse_object_data(self, type_id, object_data): 177 | proto = self._get_proto_for_type(type_id) 178 | 179 | if proto is None: 180 | return 181 | 182 | if not get_so_key_fields(proto.DESCRIPTOR): 183 | self._LOG.error("Unable to find key for %s" % type_id) 184 | return 185 | 186 | obj = proto.FromString(object_data) 187 | key = get_key_for_object(obj) 188 | 189 | return key, obj 190 | 191 | def _update_object(self, type_id, object_data): 192 | result = self._parse_object_data(type_id, object_data) 193 | 194 | if result: 195 | key, obj = result 196 | type_id = ESOType(type_id) 197 | 198 | if key is NO_KEY: 199 | if not isinstance(self[type_id], dict): 200 | self[type_id].CopyFrom(obj) 201 | obj = self[type_id] 202 | else: 203 | self[type_id] = obj 204 | else: 205 | if key in self[type_id]: 206 | self[type_id][key].CopyFrom(obj) 207 | obj = self[type_id][key] 208 | else: 209 | self[type_id][key] = obj 210 | 211 | return type_id, obj 212 | 213 | def _handle_create(self, message): 214 | result = self._update_object(message.type_id, message.object_data) 215 | if result: 216 | type_id, obj = result 217 | self.emit(('new', type_id), obj) 218 | 219 | def _handle_update(self, message): 220 | result = self._update_object(message.type_id, message.object_data) 221 | if result: 222 | type_id, obj = result 223 | self.emit(('updated', type_id), obj) 224 | 225 | def _handle_destroy(self, message): 226 | result = self._parse_object_data(message.type_id, message.object_data) 227 | if result: 228 | key, obj = result 229 | type_id = ESOType(message.type_id) 230 | current = None 231 | 232 | if key is NO_KEY: 233 | current = self.pop(type_id, None) 234 | else: 235 | current = self[type_id].pop(key, None) 236 | 237 | if current: current.CopyFrom(obj) 238 | 239 | self.emit(('removed', type_id), current or obj) 240 | 241 | def _handle_update_multiple(self, message): 242 | for so_object in message.objects_modified: 243 | self._handle_update(so_object) 244 | # for so_object in message.objects_added: 245 | # self._handle_create(so_object) 246 | # for so_object in message.objects_removed: 247 | # self._handle_destroy(so_object) 248 | 249 | def _handle_client_welcome(self, message): 250 | for one in message.outofdate_subscribed_caches: 251 | self._handle_cache_subscribed(one) 252 | 253 | def _handle_cache_subscribed(self, message): 254 | cache_key = message.owner_soid.type, message.owner_soid.id 255 | self._caches.setdefault(cache_key, dict()) 256 | 257 | cache = self._caches[cache_key] 258 | cache['version'] = message.version 259 | cache.setdefault('type_ids', set()).update(map(lambda x: x.type_id, message.objects)) 260 | 261 | for objects in message.objects: 262 | for object_bytes in objects.object_data: 263 | result = self._update_object(objects.type_id, object_bytes) 264 | if not result: break 265 | 266 | type_id, obj = result 267 | self.emit(('new', type_id), obj) 268 | 269 | def _handle_cache_unsubscribed(self, message): 270 | cache_key = message.owner_soid.type, message.owner_soid.id 271 | 272 | if cache_key not in self._caches: return 273 | cache = self._caches[cache_key] 274 | 275 | for type_id in cache['type_ids']: 276 | if type_id in self: 277 | type_id = ESOType(type_id) 278 | 279 | if isinstance(self[type_id], dict): 280 | for key in list(self[type_id].keys()): 281 | self.emit(('removed', type_id), self[type_id].pop(key)) 282 | else: 283 | self.emit(('removed', type_id), self.pop(type_id)) 284 | 285 | del self[type_id] 286 | del self._caches[cache_key] 287 | 288 | 289 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # csgo documentation build configuration file, created by 4 | # sphinx-quickstart on Mon Feb 15 03:43:47 2016. 5 | # 6 | # This file is execfile()d with the current directory set to its 7 | # containing dir. 8 | # 9 | # Note that not all possible configuration values are present in this 10 | # autogenerated file. 11 | # 12 | # All configuration values have a default; values that are commented out 13 | # serve to show the default. 14 | 15 | import sys 16 | import os 17 | 18 | # If extensions (or modules to document with autodoc) are in another directory, 19 | # add these directories to sys.path here. If the directory is relative to the 20 | # documentation root, use os.path.abspath to make it absolute, like shown here. 21 | sys.path.insert(0, os.path.abspath('../')) 22 | 23 | # -- General configuration ------------------------------------------------ 24 | 25 | # If your documentation needs a minimal Sphinx version, state it here. 26 | #needs_sphinx = '1.0' 27 | 28 | # Add any Sphinx extension module names here, as strings. They can be 29 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 30 | # ones. 31 | extensions = [ 32 | 'sphinx.ext.autodoc', 33 | 'sphinx.ext.intersphinx', 34 | # 'sphinx.ext.githubpages', 35 | ] 36 | 37 | # Add any paths that contain templates here, relative to this directory. 38 | templates_path = ['_templates'] 39 | 40 | # The suffix(es) of source filenames. 41 | # You can specify multiple suffix as a list of string: 42 | # source_suffix = ['.rst', '.md'] 43 | source_suffix = '.rst' 44 | 45 | # The encoding of source files. 46 | #source_encoding = 'utf-8-sig' 47 | 48 | # The master toctree document. 49 | master_doc = 'index' 50 | 51 | # General information about the project. 52 | from csgo import __version__, __author__ 53 | project = u'csgo' 54 | copyright = u'2016, %s' % __author__ 55 | author = __author__ 56 | 57 | # The version info for the project you're documenting, acts as replacement for 58 | # |version| and |release|, also used in various other places throughout the 59 | # built documents. 60 | # The short X.Y version. 61 | version = __version__ 62 | # The full version, including alpha/beta/rc tags. 63 | release = __version__ 64 | 65 | # The language for content autogenerated by Sphinx. Refer to documentation 66 | # for a list of supported languages. 67 | # 68 | # This is also used if you do content translation via gettext catalogs. 69 | # Usually you set "language" from the command line for these cases. 70 | language = 'en' 71 | 72 | # There are two options for replacing |today|: either, you set today to some 73 | # non-false value, then it is used: 74 | #today = '' 75 | # Else, today_fmt is used as the format for a strftime call. 76 | #today_fmt = '%B %d, %Y' 77 | 78 | # List of patterns, relative to source directory, that match files and 79 | # directories to ignore when looking for source files. 80 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] 81 | 82 | # The reST default role (used for this markup: `text`) to use for all 83 | # documents. 84 | #default_role = None 85 | 86 | # If true, '()' will be appended to :func: etc. cross-reference text. 87 | #add_function_parentheses = True 88 | 89 | # If true, the current module name will be prepended to all description 90 | # unit titles (such as .. function::). 91 | #add_module_names = True 92 | 93 | # If true, sectionauthor and moduleauthor directives will be shown in the 94 | # output. They are ignored by default. 95 | #show_authors = False 96 | 97 | # The name of the Pygments (syntax highlighting) style to use. 98 | pygments_style = 'sphinx' 99 | 100 | # A list of ignored prefixes for module index sorting. 101 | #modindex_common_prefix = [] 102 | 103 | # If true, keep warnings as "system message" paragraphs in the built documents. 104 | #keep_warnings = False 105 | 106 | # If true, `todo` and `todoList` produce output, else they produce nothing. 107 | todo_include_todos = True 108 | 109 | 110 | # -- Options for HTML output ---------------------------------------------- 111 | 112 | # The theme to use for HTML and HTML Help pages. See the documentation for 113 | # a list of builtin themes. 114 | html_theme = 'sphinx_rtd_theme' 115 | 116 | # Theme options are theme-specific and customize the look and feel of a theme 117 | # further. For a list of options available for each theme, see the 118 | # documentation. 119 | #html_theme_options = {} 120 | 121 | # Add any paths that contain custom themes here, relative to this directory. 122 | #html_theme_path = [] 123 | 124 | # The name for this set of Sphinx documents. 125 | # " v documentation" by default. 126 | #html_title = u'csgo v' 127 | 128 | # A shorter title for the navigation bar. Default is the same as html_title. 129 | #html_short_title = None 130 | 131 | # The name of an image file (relative to this directory) to place at the top 132 | # of the sidebar. 133 | #html_logo = None 134 | 135 | # The name of an image file (within the static path) to use as favicon of the 136 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 137 | # pixels large. 138 | #html_favicon = None 139 | 140 | # Add any paths that contain custom static files (such as style sheets) here, 141 | # relative to this directory. They are copied after the builtin static files, 142 | # so a file named "default.css" will overwrite the builtin "default.css". 143 | html_static_path = ['_static'] 144 | 145 | # Add any extra paths that contain custom files (such as robots.txt or 146 | # .htaccess) here, relative to this directory. These files are copied 147 | # directly to the root of the documentation. 148 | #html_extra_path = [] 149 | 150 | # If not None, a 'Last updated on:' timestamp is inserted at every page 151 | # bottom, using the given strftime format. 152 | # The empty string is equivalent to '%b %d, %Y'. 153 | #html_last_updated_fmt = None 154 | 155 | # If true, SmartyPants will be used to convert quotes and dashes to 156 | # typographically correct entities. 157 | #html_use_smartypants = True 158 | 159 | # Custom sidebar templates, maps document names to template names. 160 | #html_sidebars = {} 161 | 162 | # Additional templates that should be rendered to pages, maps page names to 163 | # template names. 164 | #html_additional_pages = {} 165 | 166 | # If false, no module index is generated. 167 | #html_domain_indices = True 168 | 169 | # If false, no index is generated. 170 | #html_use_index = True 171 | 172 | # If true, the index is split into individual pages for each letter. 173 | #html_split_index = False 174 | 175 | # If true, links to the reST sources are added to the pages. 176 | html_show_sourcelink = True 177 | 178 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 179 | html_show_sphinx = True 180 | 181 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 182 | #html_show_copyright = True 183 | 184 | # If true, an OpenSearch description file will be output, and all pages will 185 | # contain a tag referring to it. The value of this option must be the 186 | # base URL from which the finished HTML is served. 187 | #html_use_opensearch = '' 188 | 189 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 190 | #html_file_suffix = None 191 | 192 | # Language to be used for generating the HTML full-text search index. 193 | # Sphinx supports the following languages: 194 | # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' 195 | # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh' 196 | #html_search_language = 'en' 197 | 198 | # A dictionary with options for the search language support, empty by default. 199 | # 'ja' uses this config value. 200 | # 'zh' user can custom change `jieba` dictionary path. 201 | #html_search_options = {'type': 'default'} 202 | 203 | # The name of a javascript file (relative to the configuration directory) that 204 | # implements a search results scorer. If empty, the default will be used. 205 | #html_search_scorer = 'scorer.js' 206 | 207 | # Output file base name for HTML help builder. 208 | htmlhelp_basename = 'csgodoc' 209 | 210 | # -- Options for LaTeX output --------------------------------------------- 211 | 212 | latex_elements = { 213 | # The paper size ('letterpaper' or 'a4paper'). 214 | #'papersize': 'letterpaper', 215 | 216 | # The font size ('10pt', '11pt' or '12pt'). 217 | #'pointsize': '10pt', 218 | 219 | # Additional stuff for the LaTeX preamble. 220 | #'preamble': '', 221 | 222 | # Latex figure (float) alignment 223 | #'figure_align': 'htbp', 224 | } 225 | 226 | # Grouping the document tree into LaTeX files. List of tuples 227 | # (source start file, target name, title, 228 | # author, documentclass [howto, manual, or own class]). 229 | latex_documents = [ 230 | (master_doc, 'csgo.tex', u'csgo Documentation', 231 | version, 'manual'), 232 | ] 233 | 234 | # The name of an image file (relative to this directory) to place at the top of 235 | # the title page. 236 | #latex_logo = None 237 | 238 | # For "manual" documents, if this is true, then toplevel headings are parts, 239 | # not chapters. 240 | #latex_use_parts = False 241 | 242 | # If true, show page references after internal links. 243 | #latex_show_pagerefs = False 244 | 245 | # If true, show URL addresses after external links. 246 | #latex_show_urls = False 247 | 248 | # Documents to append as an appendix to all manuals. 249 | #latex_appendices = [] 250 | 251 | # If false, no module index is generated. 252 | #latex_domain_indices = True 253 | 254 | 255 | # -- Options for manual page output --------------------------------------- 256 | 257 | # One entry per manual page. List of tuples 258 | # (source start file, name, description, authors, manual section). 259 | man_pages = [ 260 | (master_doc, 'csgo', u'csgo Documentation', 261 | [author], 1) 262 | ] 263 | 264 | # If true, show URL addresses after external links. 265 | #man_show_urls = False 266 | 267 | 268 | # -- Options for Texinfo output ------------------------------------------- 269 | 270 | # Grouping the document tree into Texinfo files. List of tuples 271 | # (source start file, target name, title, author, 272 | # dir menu entry, description, category) 273 | texinfo_documents = [ 274 | (master_doc, 'csgo', u'csgo Documentation', 275 | author, 'csgo', 'One line description of project.', 276 | 'Miscellaneous'), 277 | ] 278 | 279 | # Documents to append as an appendix to all manuals. 280 | #texinfo_appendices = [] 281 | 282 | # If false, no module index is generated. 283 | #texinfo_domain_indices = True 284 | 285 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 286 | #texinfo_show_urls = 'footnote' 287 | 288 | # If true, do not generate a @detailmenu in the "Top" node's menu. 289 | #texinfo_no_detailmenu = False 290 | 291 | 292 | # -- Options for Epub output ---------------------------------------------- 293 | 294 | # Bibliographic Dublin Core info. 295 | epub_title = project 296 | epub_author = author 297 | epub_publisher = author 298 | epub_copyright = copyright 299 | 300 | # The basename for the epub file. It defaults to the project name. 301 | #epub_basename = project 302 | 303 | # The HTML theme for the epub output. Since the default themes are not 304 | # optimized for small screen space, using the same theme for HTML and epub 305 | # output is usually not wise. This defaults to 'epub', a theme designed to save 306 | # visual space. 307 | #epub_theme = 'epub' 308 | 309 | # The language of the text. It defaults to the language option 310 | # or 'en' if the language is not set. 311 | #epub_language = '' 312 | 313 | # The scheme of the identifier. Typical schemes are ISBN or URL. 314 | #epub_scheme = '' 315 | 316 | # The unique identifier of the text. This can be a ISBN number 317 | # or the project homepage. 318 | #epub_identifier = '' 319 | 320 | # A unique identification for the text. 321 | #epub_uid = '' 322 | 323 | # A tuple containing the cover image and cover page html template filenames. 324 | #epub_cover = () 325 | 326 | # A sequence of (type, uri, title) tuples for the guide element of content.opf. 327 | #epub_guide = () 328 | 329 | # HTML files that should be inserted before the pages created by sphinx. 330 | # The format is a list of tuples containing the path and title. 331 | #epub_pre_files = [] 332 | 333 | # HTML files shat should be inserted after the pages created by sphinx. 334 | # The format is a list of tuples containing the path and title. 335 | #epub_post_files = [] 336 | 337 | # A list of files that should not be packed into the epub file. 338 | epub_exclude_files = ['search.html'] 339 | 340 | # The depth of the table of contents in toc.ncx. 341 | #epub_tocdepth = 3 342 | 343 | # Allow duplicate toc entries. 344 | #epub_tocdup = True 345 | 346 | # Choose between 'default' and 'includehidden'. 347 | #epub_tocscope = 'default' 348 | 349 | # Fix unsupported image types using the Pillow. 350 | #epub_fix_images = False 351 | 352 | # Scale large images. 353 | #epub_max_image_width = 0 354 | 355 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 356 | #epub_show_urls = 'inline' 357 | 358 | # If false, no index is generated. 359 | #epub_use_index = True 360 | 361 | # LINK EXTERNAL DOCS 362 | 363 | intersphinx_mapping = { 364 | 'python': ('https://docs.python.org/3.6', None), 365 | 'gevent': ('http://www.gevent.org', None), 366 | 'requests': ('https://2.python-requests.org/en/master/', None), 367 | 'steam': ('https://steam.readthedocs.io/en/stable/', None), 368 | } 369 | 370 | # AUTODOC 371 | autodoc_member_order = 'bysource' 372 | -------------------------------------------------------------------------------- /protobufs/base_gcmessages.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package csgo; 3 | import "steammessages.proto"; 4 | 5 | option optimize_for = SPEED; 6 | option py_generic_services = false; 7 | 8 | enum EGCBaseMsg { 9 | k_EMsgGCSystemMessage = 4001; 10 | k_EMsgGCReplicateConVars = 4002; 11 | k_EMsgGCConVarUpdated = 4003; 12 | k_EMsgGCInQueue = 4008; 13 | k_EMsgGCInviteToParty = 4501; 14 | k_EMsgGCInvitationCreated = 4502; 15 | k_EMsgGCPartyInviteResponse = 4503; 16 | k_EMsgGCKickFromParty = 4504; 17 | k_EMsgGCLeaveParty = 4505; 18 | k_EMsgGCServerAvailable = 4506; 19 | k_EMsgGCClientConnectToServer = 4507; 20 | k_EMsgGCGameServerInfo = 4508; 21 | k_EMsgGCError = 4509; 22 | k_EMsgGCReplay_UploadedToYouTube = 4510; 23 | k_EMsgGCLANServerAvailable = 4511; 24 | } 25 | 26 | enum EGCBaseProtoObjectTypes { 27 | k_EProtoObjectPartyInvite = 1001; 28 | k_EProtoObjectLobbyInvite = 1002; 29 | } 30 | 31 | enum GC_BannedWordType { 32 | GC_BANNED_WORD_DISABLE_WORD = 0; 33 | GC_BANNED_WORD_ENABLE_WORD = 1; 34 | } 35 | 36 | message CGCStorePurchaseInit_LineItem { 37 | optional uint32 item_def_id = 1; 38 | optional uint32 quantity = 2; 39 | optional uint32 cost_in_local_currency = 3; 40 | optional uint32 purchase_type = 4; 41 | } 42 | 43 | message CMsgGCStorePurchaseInit { 44 | optional string country = 1; 45 | optional int32 language = 2; 46 | optional int32 currency = 3; 47 | repeated csgo.CGCStorePurchaseInit_LineItem line_items = 4; 48 | } 49 | 50 | message CMsgGCStorePurchaseInitResponse { 51 | optional int32 result = 1; 52 | optional uint64 txn_id = 2; 53 | optional string url = 3; 54 | repeated uint64 item_ids = 4; 55 | } 56 | 57 | message CSOPartyInvite { 58 | optional uint64 group_id = 1 [(key_field) = true]; 59 | optional fixed64 sender_id = 2; 60 | optional string sender_name = 3; 61 | } 62 | 63 | message CSOLobbyInvite { 64 | optional uint64 group_id = 1 [(key_field) = true]; 65 | optional fixed64 sender_id = 2; 66 | optional string sender_name = 3; 67 | } 68 | 69 | message CMsgSystemBroadcast { 70 | optional string message = 1; 71 | } 72 | 73 | message CMsgInviteToParty { 74 | optional fixed64 steam_id = 1; 75 | optional uint32 client_version = 2; 76 | optional uint32 team_invite = 3; 77 | } 78 | 79 | message CMsgInvitationCreated { 80 | optional uint64 group_id = 1; 81 | optional fixed64 steam_id = 2; 82 | } 83 | 84 | message CMsgPartyInviteResponse { 85 | optional uint64 party_id = 1; 86 | optional bool accept = 2; 87 | optional uint32 client_version = 3; 88 | optional uint32 team_invite = 4; 89 | } 90 | 91 | message CMsgKickFromParty { 92 | optional fixed64 steam_id = 1; 93 | } 94 | 95 | message CMsgLeaveParty { 96 | } 97 | 98 | message CMsgServerAvailable { 99 | } 100 | 101 | message CMsgLANServerAvailable { 102 | optional fixed64 lobby_id = 1; 103 | } 104 | 105 | message CSOEconGameAccountClient { 106 | optional uint32 additional_backpack_slots = 1 [default = 0]; 107 | optional fixed32 bonus_xp_timestamp_refresh = 12; 108 | optional uint32 bonus_xp_usedflags = 13; 109 | optional uint32 elevated_state = 14; 110 | optional uint32 elevated_timestamp = 15; 111 | } 112 | 113 | message CSOItemCriteriaCondition { 114 | optional int32 op = 1; 115 | optional string field = 2; 116 | optional bool required = 3; 117 | optional float float_value = 4; 118 | optional string string_value = 5; 119 | } 120 | 121 | message CSOItemCriteria { 122 | optional uint32 item_level = 1; 123 | optional int32 item_quality = 2; 124 | optional bool item_level_set = 3; 125 | optional bool item_quality_set = 4; 126 | optional uint32 initial_inventory = 5; 127 | optional uint32 initial_quantity = 6; 128 | optional bool ignore_enabled_flag = 8; 129 | repeated csgo.CSOItemCriteriaCondition conditions = 9; 130 | optional int32 item_rarity = 10; 131 | optional bool item_rarity_set = 11; 132 | optional bool recent_only = 12; 133 | } 134 | 135 | message CSOItemRecipe { 136 | optional uint32 def_index = 1; 137 | optional string name = 2; 138 | optional string n_a = 3; 139 | optional string desc_inputs = 4; 140 | optional string desc_outputs = 5; 141 | optional string di_a = 6; 142 | optional string di_b = 7; 143 | optional string di_c = 8; 144 | optional string do_a = 9; 145 | optional string do_b = 10; 146 | optional string do_c = 11; 147 | optional bool requires_all_same_class = 12; 148 | optional bool requires_all_same_slot = 13; 149 | optional int32 class_usage_for_output = 14; 150 | optional int32 slot_usage_for_output = 15; 151 | optional int32 set_for_output = 16; 152 | repeated csgo.CSOItemCriteria input_items_criteria = 20; 153 | repeated csgo.CSOItemCriteria output_items_criteria = 21; 154 | repeated uint32 input_item_dupe_counts = 22; 155 | } 156 | 157 | message CMsgDevNewItemRequest { 158 | optional fixed64 receiver = 1; 159 | optional csgo.CSOItemCriteria criteria = 2; 160 | } 161 | 162 | message CMsgIncrementKillCountAttribute { 163 | optional fixed32 killer_account_id = 1; 164 | optional fixed32 victim_account_id = 2; 165 | optional uint64 item_id = 3; 166 | optional uint32 event_type = 4; 167 | optional uint32 amount = 5; 168 | } 169 | 170 | message CMsgApplySticker { 171 | optional uint64 sticker_item_id = 1; 172 | optional uint64 item_item_id = 2; 173 | optional uint32 sticker_slot = 3; 174 | optional uint32 baseitem_defidx = 4; 175 | optional float sticker_wear = 5; 176 | } 177 | 178 | message CMsgModifyItemAttribute { 179 | optional uint64 item_id = 1; 180 | optional uint32 attr_defidx = 2; 181 | optional uint32 attr_value = 3; 182 | } 183 | 184 | message CMsgApplyStatTrakSwap { 185 | optional uint64 tool_item_id = 1; 186 | optional uint64 item_1_item_id = 2; 187 | optional uint64 item_2_item_id = 3; 188 | } 189 | 190 | message CMsgApplyStrangePart { 191 | optional uint64 strange_part_item_id = 1; 192 | optional uint64 item_item_id = 2; 193 | } 194 | 195 | message CMsgApplyPennantUpgrade { 196 | optional uint64 upgrade_item_id = 1; 197 | optional uint64 pennant_item_id = 2; 198 | } 199 | 200 | message CMsgApplyEggEssence { 201 | optional uint64 essence_item_id = 1; 202 | optional uint64 egg_item_id = 2; 203 | } 204 | 205 | message CSOEconItemAttribute { 206 | optional uint32 def_index = 1; 207 | optional uint32 value = 2; 208 | optional bytes value_bytes = 3; 209 | } 210 | 211 | message CSOEconItemEquipped { 212 | optional uint32 new_class = 1; 213 | optional uint32 new_slot = 2; 214 | } 215 | 216 | message CSOEconItem { 217 | optional uint64 id = 1; 218 | optional uint32 account_id = 2; 219 | optional uint32 inventory = 3; 220 | optional uint32 def_index = 4; 221 | optional uint32 quantity = 5; 222 | optional uint32 level = 6; 223 | optional uint32 quality = 7; 224 | optional uint32 flags = 8 [default = 0]; 225 | optional uint32 origin = 9; 226 | optional string custom_name = 10; 227 | optional string custom_desc = 11; 228 | repeated csgo.CSOEconItemAttribute attribute = 12; 229 | optional csgo.CSOEconItem interior_item = 13; 230 | optional bool in_use = 14 [default = false]; 231 | optional uint32 style = 15 [default = 0]; 232 | optional uint64 original_id = 16 [default = 0]; 233 | repeated csgo.CSOEconItemEquipped equipped_state = 18; 234 | optional uint32 rarity = 19; 235 | } 236 | 237 | message CMsgAdjustItemEquippedState { 238 | optional uint64 item_id = 1; 239 | optional uint32 new_class = 2; 240 | optional uint32 new_slot = 3; 241 | optional bool swap = 4; 242 | } 243 | 244 | message CMsgAdjustItemEquippedStateMulti { 245 | repeated uint64 t_equips = 1; 246 | repeated uint64 ct_equips = 2; 247 | repeated uint64 noteam_equips = 3; 248 | } 249 | 250 | message CMsgSortItems { 251 | optional uint32 sort_type = 1; 252 | } 253 | 254 | message CSOEconClaimCode { 255 | optional uint32 account_id = 1; 256 | optional uint32 code_type = 2; 257 | optional uint32 time_acquired = 3; 258 | optional string code = 4; 259 | } 260 | 261 | message CMsgStoreGetUserData { 262 | optional fixed32 price_sheet_version = 1; 263 | optional int32 currency = 2; 264 | } 265 | 266 | message CMsgStoreGetUserDataResponse { 267 | optional int32 result = 1; 268 | optional int32 currency_deprecated = 2; 269 | optional string country_deprecated = 3; 270 | optional fixed32 price_sheet_version = 4; 271 | optional bytes price_sheet = 8; 272 | } 273 | 274 | message CMsgUpdateItemSchema { 275 | optional bytes items_game = 1; 276 | optional fixed32 item_schema_version = 2; 277 | optional string items_game_url_DEPRECATED2013 = 3; 278 | optional string items_game_url = 4; 279 | } 280 | 281 | message CMsgGCError { 282 | optional string error_text = 1; 283 | } 284 | 285 | message CMsgRequestInventoryRefresh { 286 | } 287 | 288 | message CMsgConVarValue { 289 | optional string name = 1; 290 | optional string value = 2; 291 | } 292 | 293 | message CMsgReplicateConVars { 294 | repeated csgo.CMsgConVarValue convars = 1; 295 | } 296 | 297 | message CMsgUseItem { 298 | optional uint64 item_id = 1; 299 | optional fixed64 target_steam_id = 2; 300 | repeated uint32 gift__potential_targets = 3; 301 | optional uint32 duel__class_lock = 4; 302 | optional fixed64 initiator_steam_id = 5; 303 | } 304 | 305 | message CMsgReplayUploadedToYouTube { 306 | optional string youtube_url = 1; 307 | optional string youtube_account_name = 2; 308 | optional uint64 session_id = 3; 309 | } 310 | 311 | message CMsgConsumableExhausted { 312 | optional int32 item_def_id = 1; 313 | } 314 | 315 | message CMsgItemAcknowledged__DEPRECATED { 316 | optional uint32 account_id = 1; 317 | optional uint32 inventory = 2; 318 | optional uint32 def_index = 3; 319 | optional uint32 quality = 4; 320 | optional uint32 rarity = 5; 321 | optional uint32 origin = 6; 322 | optional uint64 item_id = 7; 323 | } 324 | 325 | message CMsgSetItemPositions { 326 | message ItemPosition { 327 | optional uint32 legacy_item_id = 1; 328 | optional uint32 position = 2; 329 | optional uint64 item_id = 3; 330 | } 331 | 332 | repeated csgo.CMsgSetItemPositions.ItemPosition item_positions = 1; 333 | } 334 | 335 | message CMsgGCReportAbuse { 336 | optional fixed64 target_steam_id = 1; 337 | optional string description = 4; 338 | optional uint64 gid = 5; 339 | optional uint32 abuse_type = 2; 340 | optional uint32 content_type = 3; 341 | optional fixed32 target_game_server_ip = 6; 342 | optional uint32 target_game_server_port = 7; 343 | } 344 | 345 | message CMsgGCReportAbuseResponse { 346 | optional fixed64 target_steam_id = 1; 347 | optional uint32 result = 2; 348 | optional string error_message = 3; 349 | } 350 | 351 | message CMsgGCNameItemNotification { 352 | optional fixed64 player_steamid = 1; 353 | optional uint32 item_def_index = 2; 354 | optional string item_name_custom = 3; 355 | } 356 | 357 | message CMsgGCClientDisplayNotification { 358 | optional string notification_title_localization_key = 1; 359 | optional string notification_body_localization_key = 2; 360 | repeated string body_substring_keys = 3; 361 | repeated string body_substring_values = 4; 362 | } 363 | 364 | message CMsgGCShowItemsPickedUp { 365 | optional fixed64 player_steamid = 1; 366 | } 367 | 368 | message CMsgGCIncrementKillCountResponse { 369 | optional uint32 killer_account_id = 1 [(key_field) = true]; 370 | optional uint32 num_kills = 2; 371 | optional uint32 item_def = 3; 372 | optional uint32 level_type = 4; 373 | } 374 | 375 | message CSOEconItemDropRateBonus { 376 | optional uint32 account_id = 1; 377 | optional fixed32 expiration_date = 2; 378 | optional float bonus = 3; 379 | optional uint32 bonus_count = 4; 380 | optional uint64 item_id = 5; 381 | optional uint32 def_index = 6; 382 | } 383 | 384 | message CSOEconItemLeagueViewPass { 385 | optional uint32 account_id = 1 [(key_field) = true]; 386 | optional uint32 league_id = 2 [(key_field) = true]; 387 | optional uint32 admin = 3; 388 | optional uint32 itemindex = 4; 389 | } 390 | 391 | message CSOEconItemEventTicket { 392 | optional uint32 account_id = 1; 393 | optional uint32 event_id = 2; 394 | optional uint64 item_id = 3; 395 | } 396 | 397 | message CMsgGCItemPreviewItemBoughtNotification { 398 | optional uint32 item_def_index = 1; 399 | } 400 | 401 | message CMsgGCStorePurchaseCancel { 402 | optional uint64 txn_id = 1; 403 | } 404 | 405 | message CMsgGCStorePurchaseCancelResponse { 406 | optional uint32 result = 1; 407 | } 408 | 409 | message CMsgGCStorePurchaseFinalize { 410 | optional uint64 txn_id = 1; 411 | } 412 | 413 | message CMsgGCStorePurchaseFinalizeResponse { 414 | optional uint32 result = 1; 415 | repeated uint64 item_ids = 2; 416 | } 417 | 418 | message CMsgGCBannedWordListRequest { 419 | optional uint32 ban_list_group_id = 1; 420 | optional uint32 word_id = 2; 421 | } 422 | 423 | message CMsgGCRequestAnnouncements { 424 | } 425 | 426 | message CMsgGCRequestAnnouncementsResponse { 427 | optional string announcement_title = 1; 428 | optional string announcement = 2; 429 | optional string nextmatch_title = 3; 430 | optional string nextmatch = 4; 431 | } 432 | 433 | message CMsgGCBannedWord { 434 | optional uint32 word_id = 1; 435 | optional csgo.GC_BannedWordType word_type = 2 [default = GC_BANNED_WORD_DISABLE_WORD]; 436 | optional string word = 3; 437 | } 438 | 439 | message CMsgGCBannedWordListResponse { 440 | optional uint32 ban_list_group_id = 1; 441 | repeated csgo.CMsgGCBannedWord word_list = 2; 442 | } 443 | 444 | message CMsgGCToGCBannedWordListBroadcast { 445 | optional csgo.CMsgGCBannedWordListResponse broadcast = 1; 446 | } 447 | 448 | message CMsgGCToGCBannedWordListUpdated { 449 | optional uint32 group_id = 1; 450 | } 451 | 452 | message CSOEconDefaultEquippedDefinitionInstanceClient { 453 | optional uint32 account_id = 1 [(key_field) = true]; 454 | optional uint32 item_definition = 2; 455 | optional uint32 class_id = 3 [(key_field) = true]; 456 | optional uint32 slot_id = 4 [(key_field) = true]; 457 | } 458 | 459 | message CMsgGCToGCDirtySDOCache { 460 | optional uint32 sdo_type = 1; 461 | optional uint64 key_uint64 = 2; 462 | } 463 | 464 | message CMsgGCToGCDirtyMultipleSDOCache { 465 | optional uint32 sdo_type = 1; 466 | repeated uint64 key_uint64 = 2; 467 | } 468 | 469 | message CMsgGCCollectItem { 470 | optional uint64 collection_item_id = 1; 471 | optional uint64 subject_item_id = 2; 472 | } 473 | 474 | message CMsgSDONoMemcached { 475 | } 476 | 477 | message CMsgGCToGCUpdateSQLKeyValue { 478 | optional string key_name = 1; 479 | } 480 | 481 | message CMsgGCToGCIsTrustedServer { 482 | optional fixed64 steam_id = 1; 483 | } 484 | 485 | message CMsgGCToGCIsTrustedServerResponse { 486 | optional bool is_trusted = 1; 487 | } 488 | 489 | message CMsgGCToGCBroadcastConsoleCommand { 490 | optional string con_command = 1; 491 | } 492 | 493 | message CMsgGCServerVersionUpdated { 494 | optional uint32 server_version = 1; 495 | } 496 | 497 | message CMsgGCClientVersionUpdated { 498 | optional uint32 client_version = 1; 499 | } 500 | 501 | message CMsgGCToGCWebAPIAccountChanged { 502 | } 503 | 504 | message CMsgGCToGCRequestPassportItemGrant { 505 | optional fixed64 steam_id = 1; 506 | optional uint32 league_id = 2; 507 | optional int32 reward_flag = 3; 508 | } 509 | 510 | message CMsgGameServerInfo { 511 | enum ServerType { 512 | UNSPECIFIED = 0; 513 | GAME = 1; 514 | PROXY = 2; 515 | } 516 | 517 | optional fixed32 server_public_ip_addr = 1; 518 | optional fixed32 server_private_ip_addr = 2; 519 | optional uint32 server_port = 3; 520 | optional uint32 server_tv_port = 4; 521 | optional string server_key = 5; 522 | optional bool server_hibernation = 6; 523 | optional csgo.CMsgGameServerInfo.ServerType server_type = 7 [default = UNSPECIFIED]; 524 | optional uint32 server_region = 8; 525 | optional float server_loadavg = 9; 526 | optional float server_tv_broadcast_time = 10; 527 | optional float server_game_time = 11; 528 | optional fixed64 server_relay_connected_steam_id = 12; 529 | optional uint32 relay_slots_max = 13; 530 | optional int32 relays_connected = 14; 531 | optional int32 relay_clients_connected = 15; 532 | optional fixed64 relayed_game_server_steam_id = 16; 533 | optional uint32 parent_relay_count = 17; 534 | optional fixed64 tv_secret_code = 18; 535 | } 536 | -------------------------------------------------------------------------------- /protobufs/steammessages.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package csgo; 3 | import "google/protobuf/descriptor.proto"; 4 | 5 | option optimize_for = SPEED; 6 | option py_generic_services = false; 7 | 8 | extend .google.protobuf.FieldOptions { 9 | optional bool key_field = 60000 [default = false]; 10 | } 11 | 12 | extend .google.protobuf.MessageOptions { 13 | optional int32 msgpool_soft_limit = 60000 [default = 32]; 14 | optional int32 msgpool_hard_limit = 60001 [default = 384]; 15 | } 16 | 17 | enum GCProtoBufMsgSrc { 18 | GCProtoBufMsgSrc_Unspecified = 0; 19 | GCProtoBufMsgSrc_FromSystem = 1; 20 | GCProtoBufMsgSrc_FromSteamID = 2; 21 | GCProtoBufMsgSrc_FromGC = 3; 22 | GCProtoBufMsgSrc_ReplySystem = 4; 23 | } 24 | 25 | message CMsgProtoBufHeader { 26 | option (msgpool_soft_limit) = 256; 27 | option (msgpool_hard_limit) = 1024; 28 | 29 | optional fixed64 client_steam_id = 1; 30 | optional int32 client_session_id = 2; 31 | optional uint32 source_app_id = 3; 32 | optional fixed64 job_id_source = 10 [default = 18446744073709551615]; 33 | optional fixed64 job_id_target = 11 [default = 18446744073709551615]; 34 | optional string target_job_name = 12; 35 | optional int32 eresult = 13 [default = 2]; 36 | optional string error_message = 14; 37 | optional uint32 ip = 15; 38 | optional csgo.GCProtoBufMsgSrc gc_msg_src = 200 [default = GCProtoBufMsgSrc_Unspecified]; 39 | optional uint32 gc_dir_index_source = 201; 40 | } 41 | 42 | message CMsgWebAPIKey { 43 | optional uint32 status = 1 [default = 255]; 44 | optional uint32 account_id = 2 [default = 0]; 45 | optional uint32 publisher_group_id = 3 [default = 0]; 46 | optional uint32 key_id = 4; 47 | optional string domain = 5; 48 | } 49 | 50 | message CMsgHttpRequest { 51 | message RequestHeader { 52 | optional string name = 1; 53 | optional string value = 2; 54 | } 55 | 56 | message QueryParam { 57 | optional string name = 1; 58 | optional bytes value = 2; 59 | } 60 | 61 | optional uint32 request_method = 1; 62 | optional string hostname = 2; 63 | optional string url = 3; 64 | repeated csgo.CMsgHttpRequest.RequestHeader headers = 4; 65 | repeated csgo.CMsgHttpRequest.QueryParam get_params = 5; 66 | repeated csgo.CMsgHttpRequest.QueryParam post_params = 6; 67 | optional bytes body = 7; 68 | optional uint32 absolute_timeout = 8; 69 | } 70 | 71 | message CMsgWebAPIRequest { 72 | optional string UNUSED_job_name = 1; 73 | optional string interface_name = 2; 74 | optional string method_name = 3; 75 | optional uint32 version = 4; 76 | optional csgo.CMsgWebAPIKey api_key = 5; 77 | optional csgo.CMsgHttpRequest request = 6; 78 | optional uint32 routing_app_id = 7; 79 | } 80 | 81 | message CMsgHttpResponse { 82 | message ResponseHeader { 83 | optional string name = 1; 84 | optional string value = 2; 85 | } 86 | 87 | optional uint32 status_code = 1; 88 | repeated csgo.CMsgHttpResponse.ResponseHeader headers = 2; 89 | optional bytes body = 3; 90 | } 91 | 92 | message CMsgAMFindAccounts { 93 | optional uint32 search_type = 1; 94 | optional string search_string = 2; 95 | } 96 | 97 | message CMsgAMFindAccountsResponse { 98 | repeated fixed64 steam_id = 1; 99 | } 100 | 101 | message CMsgNotifyWatchdog { 102 | optional uint32 source = 1; 103 | optional uint32 alert_type = 2; 104 | optional uint32 alert_destination = 3; 105 | optional bool critical = 4; 106 | optional uint32 time = 5; 107 | optional uint32 appid = 6; 108 | optional string text = 7; 109 | } 110 | 111 | message CMsgAMGetLicenses { 112 | optional fixed64 steamid = 1; 113 | } 114 | 115 | message CMsgPackageLicense { 116 | optional uint32 package_id = 1; 117 | optional uint32 time_created = 2; 118 | optional uint32 owner_id = 3; 119 | } 120 | 121 | message CMsgAMGetLicensesResponse { 122 | repeated csgo.CMsgPackageLicense license = 1; 123 | optional uint32 result = 2; 124 | } 125 | 126 | message CMsgAMGetUserGameStats { 127 | optional fixed64 steam_id = 1; 128 | optional fixed64 game_id = 2; 129 | repeated uint32 stats = 3; 130 | } 131 | 132 | message CMsgAMGetUserGameStatsResponse { 133 | message Stats { 134 | optional uint32 stat_id = 1; 135 | optional uint32 stat_value = 2; 136 | } 137 | 138 | message Achievement_Blocks { 139 | optional uint32 achievement_id = 1; 140 | optional uint32 achievement_bit_id = 2; 141 | optional fixed32 unlock_time = 3; 142 | } 143 | 144 | optional fixed64 steam_id = 1; 145 | optional fixed64 game_id = 2; 146 | optional int32 eresult = 3 [default = 2]; 147 | repeated csgo.CMsgAMGetUserGameStatsResponse.Stats stats = 4; 148 | repeated csgo.CMsgAMGetUserGameStatsResponse.Achievement_Blocks achievement_blocks = 5; 149 | } 150 | 151 | message CMsgGCGetCommandList { 152 | optional uint32 app_id = 1; 153 | optional string command_prefix = 2; 154 | } 155 | 156 | message CMsgGCGetCommandListResponse { 157 | repeated string command_name = 1; 158 | } 159 | 160 | message CGCMsgMemCachedGet { 161 | repeated string keys = 1; 162 | } 163 | 164 | message CGCMsgMemCachedGetResponse { 165 | message ValueTag { 166 | optional bool found = 1; 167 | optional bytes value = 2; 168 | } 169 | 170 | repeated csgo.CGCMsgMemCachedGetResponse.ValueTag values = 1; 171 | } 172 | 173 | message CGCMsgMemCachedSet { 174 | message KeyPair { 175 | optional string name = 1; 176 | optional bytes value = 2; 177 | } 178 | 179 | repeated csgo.CGCMsgMemCachedSet.KeyPair keys = 1; 180 | } 181 | 182 | message CGCMsgMemCachedDelete { 183 | repeated string keys = 1; 184 | } 185 | 186 | message CGCMsgMemCachedStats { 187 | } 188 | 189 | message CGCMsgMemCachedStatsResponse { 190 | optional uint64 curr_connections = 1; 191 | optional uint64 cmd_get = 2; 192 | optional uint64 cmd_set = 3; 193 | optional uint64 cmd_flush = 4; 194 | optional uint64 get_hits = 5; 195 | optional uint64 get_misses = 6; 196 | optional uint64 delete_hits = 7; 197 | optional uint64 delete_misses = 8; 198 | optional uint64 bytes_read = 9; 199 | optional uint64 bytes_written = 10; 200 | optional uint64 limit_maxbytes = 11; 201 | optional uint64 curr_items = 12; 202 | optional uint64 evictions = 13; 203 | optional uint64 bytes = 14; 204 | } 205 | 206 | message CGCMsgSQLStats { 207 | optional uint32 schema_catalog = 1; 208 | } 209 | 210 | message CGCMsgSQLStatsResponse { 211 | optional uint32 threads = 1; 212 | optional uint32 threads_connected = 2; 213 | optional uint32 threads_active = 3; 214 | optional uint32 operations_submitted = 4; 215 | optional uint32 prepared_statements_executed = 5; 216 | optional uint32 non_prepared_statements_executed = 6; 217 | optional uint32 deadlock_retries = 7; 218 | optional uint32 operations_timed_out_in_queue = 8; 219 | optional uint32 errors = 9; 220 | } 221 | 222 | message CMsgAMAddFreeLicense { 223 | optional fixed64 steamid = 1; 224 | optional uint32 ip_public = 2; 225 | optional uint32 packageid = 3; 226 | optional string store_country_code = 4; 227 | } 228 | 229 | message CMsgAMAddFreeLicenseResponse { 230 | optional int32 eresult = 1 [default = 2]; 231 | optional int32 purchase_result_detail = 2; 232 | optional fixed64 transid = 3; 233 | } 234 | 235 | message CGCMsgGetIPLocation { 236 | repeated fixed32 ips = 1; 237 | } 238 | 239 | message CIPLocationInfo { 240 | optional uint32 ip = 1; 241 | optional float latitude = 2; 242 | optional float longitude = 3; 243 | optional string country = 4; 244 | optional string state = 5; 245 | optional string city = 6; 246 | } 247 | 248 | message CGCMsgGetIPLocationResponse { 249 | repeated csgo.CIPLocationInfo infos = 1; 250 | } 251 | 252 | message CGCMsgSystemStatsSchema { 253 | optional uint32 gc_app_id = 1; 254 | optional bytes schema_kv = 2; 255 | } 256 | 257 | message CGCMsgGetSystemStats { 258 | } 259 | 260 | message CGCMsgGetSystemStatsResponse { 261 | optional uint32 gc_app_id = 1; 262 | optional bytes stats_kv = 2; 263 | optional uint32 active_jobs = 3; 264 | optional uint32 yielding_jobs = 4; 265 | optional uint32 user_sessions = 5; 266 | optional uint32 game_server_sessions = 6; 267 | optional uint32 socaches = 7; 268 | optional uint32 socaches_to_unload = 8; 269 | optional uint32 socaches_loading = 9; 270 | optional uint32 writeback_queue = 10; 271 | optional uint32 steamid_locks = 11; 272 | optional uint32 logon_queue = 12; 273 | optional uint32 logon_jobs = 13; 274 | } 275 | 276 | message CMsgAMSendEmail { 277 | message ReplacementToken { 278 | optional string token_name = 1; 279 | optional string token_value = 2; 280 | } 281 | 282 | message PersonaNameReplacementToken { 283 | optional fixed64 steamid = 1; 284 | optional string token_name = 2; 285 | } 286 | 287 | optional fixed64 steamid = 1; 288 | optional uint32 email_msg_type = 2; 289 | optional uint32 email_format = 3; 290 | repeated csgo.CMsgAMSendEmail.PersonaNameReplacementToken persona_name_tokens = 5; 291 | optional uint32 source_gc = 6; 292 | repeated csgo.CMsgAMSendEmail.ReplacementToken tokens = 7; 293 | } 294 | 295 | message CMsgAMSendEmailResponse { 296 | optional uint32 eresult = 1 [default = 2]; 297 | } 298 | 299 | message CMsgGCGetEmailTemplate { 300 | optional uint32 app_id = 1; 301 | optional uint32 email_msg_type = 2; 302 | optional int32 email_lang = 3; 303 | optional int32 email_format = 4; 304 | } 305 | 306 | message CMsgGCGetEmailTemplateResponse { 307 | optional uint32 eresult = 1 [default = 2]; 308 | optional bool template_exists = 2; 309 | optional string template = 3; 310 | } 311 | 312 | message CMsgAMGrantGuestPasses2 { 313 | optional fixed64 steam_id = 1; 314 | optional uint32 package_id = 2; 315 | optional int32 passes_to_grant = 3; 316 | optional int32 days_to_expiration = 4; 317 | optional int32 action = 5; 318 | } 319 | 320 | message CMsgAMGrantGuestPasses2Response { 321 | optional int32 eresult = 1 [default = 2]; 322 | optional int32 passes_granted = 2 [default = 0]; 323 | } 324 | 325 | message CGCSystemMsg_GetAccountDetails { 326 | option (msgpool_soft_limit) = 128; 327 | option (msgpool_hard_limit) = 512; 328 | 329 | optional fixed64 steamid = 1; 330 | optional uint32 appid = 2; 331 | } 332 | 333 | message CGCSystemMsg_GetAccountDetails_Response { 334 | option (msgpool_soft_limit) = 128; 335 | option (msgpool_hard_limit) = 512; 336 | 337 | optional uint32 eresult_deprecated = 1 [default = 2]; 338 | optional string account_name = 2; 339 | optional string persona_name = 3; 340 | optional bool is_profile_public = 4; 341 | optional bool is_inventory_public = 5; 342 | optional bool is_vac_banned = 7; 343 | optional bool is_cyber_cafe = 8; 344 | optional bool is_school_account = 9; 345 | optional bool is_limited = 10; 346 | optional bool is_subscribed = 11; 347 | optional uint32 package = 12; 348 | optional bool is_free_trial_account = 13; 349 | optional uint32 free_trial_expiration = 14; 350 | optional bool is_low_violence = 15; 351 | optional bool is_account_locked_down = 16; 352 | optional bool is_community_banned = 17; 353 | optional bool is_trade_banned = 18; 354 | optional uint32 trade_ban_expiration = 19; 355 | optional uint32 accountid = 20; 356 | optional uint32 suspension_end_time = 21; 357 | optional string currency = 22; 358 | optional uint32 steam_level = 23; 359 | optional uint32 friend_count = 24; 360 | optional uint32 account_creation_time = 25; 361 | optional bool is_steamguard_enabled = 27; 362 | optional bool is_phone_verified = 28; 363 | optional bool is_two_factor_auth_enabled = 29; 364 | optional uint32 two_factor_enabled_time = 30; 365 | optional uint32 phone_verification_time = 31; 366 | optional uint64 phone_id = 33; 367 | optional bool is_phone_identifying = 34; 368 | optional uint32 rt_identity_linked = 35; 369 | optional uint32 rt_birth_date = 36; 370 | optional string txn_country_code = 37; 371 | } 372 | 373 | message CMsgGCGetPersonaNames { 374 | repeated fixed64 steamids = 1; 375 | } 376 | 377 | message CMsgGCGetPersonaNames_Response { 378 | message PersonaName { 379 | optional fixed64 steamid = 1; 380 | optional string persona_name = 2; 381 | } 382 | 383 | repeated csgo.CMsgGCGetPersonaNames_Response.PersonaName succeeded_lookups = 1; 384 | repeated fixed64 failed_lookup_steamids = 2; 385 | } 386 | 387 | message CMsgGCCheckFriendship { 388 | optional fixed64 steamid_left = 1; 389 | optional fixed64 steamid_right = 2; 390 | } 391 | 392 | message CMsgGCCheckFriendship_Response { 393 | optional bool success = 1; 394 | optional bool found_friendship = 2; 395 | } 396 | 397 | message CMsgGCMsgMasterSetDirectory { 398 | message SubGC { 399 | optional uint32 dir_index = 1; 400 | optional string name = 2; 401 | optional string box = 3; 402 | optional string command_line = 4; 403 | optional string gc_binary = 5; 404 | } 405 | 406 | optional uint32 master_dir_index = 1; 407 | repeated csgo.CMsgGCMsgMasterSetDirectory.SubGC dir = 2; 408 | } 409 | 410 | message CMsgGCMsgMasterSetDirectory_Response { 411 | optional int32 eresult = 1 [default = 2]; 412 | } 413 | 414 | message CMsgGCMsgWebAPIJobRequestForwardResponse { 415 | optional uint32 dir_index = 1; 416 | } 417 | 418 | message CGCSystemMsg_GetPurchaseTrust_Request { 419 | optional fixed64 steamid = 1; 420 | } 421 | 422 | message CGCSystemMsg_GetPurchaseTrust_Response { 423 | optional bool has_prior_purchase_history = 1; 424 | optional bool has_no_recent_password_resets = 2; 425 | optional bool is_wallet_cash_trusted = 3; 426 | optional uint32 time_all_trusted = 4; 427 | } 428 | 429 | message CMsgGCHAccountVacStatusChange { 430 | optional fixed64 steam_id = 1; 431 | optional uint32 app_id = 2; 432 | optional uint32 rtime_vacban_starts = 3; 433 | optional bool is_banned_now = 4; 434 | optional bool is_banned_future = 5; 435 | } 436 | 437 | message CMsgGCGetPartnerAccountLink { 438 | optional fixed64 steamid = 1; 439 | } 440 | 441 | message CMsgGCGetPartnerAccountLink_Response { 442 | optional uint32 pwid = 1; 443 | optional uint32 nexonid = 2; 444 | optional int32 ageclass = 3; 445 | optional bool id_verified = 4 [default = true]; 446 | optional bool is_adult = 5; 447 | } 448 | 449 | message CMsgGCRoutingInfo { 450 | enum RoutingMethod { 451 | RANDOM = 0; 452 | DISCARD = 1; 453 | CLIENT_STEAMID = 2; 454 | PROTOBUF_FIELD_UINT64 = 3; 455 | WEBAPI_PARAM_UINT64 = 4; 456 | } 457 | 458 | repeated uint32 dir_index = 1; 459 | optional csgo.CMsgGCRoutingInfo.RoutingMethod method = 2 [default = RANDOM]; 460 | optional csgo.CMsgGCRoutingInfo.RoutingMethod fallback = 3 [default = DISCARD]; 461 | optional uint32 protobuf_field = 4; 462 | optional string webapi_param = 5; 463 | } 464 | 465 | message CMsgGCMsgMasterSetWebAPIRouting { 466 | message Entry { 467 | optional string interface_name = 1; 468 | optional string method_name = 2; 469 | optional csgo.CMsgGCRoutingInfo routing = 3; 470 | } 471 | 472 | repeated csgo.CMsgGCMsgMasterSetWebAPIRouting.Entry entries = 1; 473 | } 474 | 475 | message CMsgGCMsgMasterSetClientMsgRouting { 476 | message Entry { 477 | optional uint32 msg_type = 1; 478 | optional csgo.CMsgGCRoutingInfo routing = 2; 479 | } 480 | 481 | repeated csgo.CMsgGCMsgMasterSetClientMsgRouting.Entry entries = 1; 482 | } 483 | 484 | message CMsgGCMsgMasterSetWebAPIRouting_Response { 485 | optional int32 eresult = 1 [default = 2]; 486 | } 487 | 488 | message CMsgGCMsgMasterSetClientMsgRouting_Response { 489 | optional int32 eresult = 1 [default = 2]; 490 | } 491 | 492 | message CMsgGCMsgSetOptions { 493 | message MessageRange { 494 | required uint32 low = 1; 495 | required uint32 high = 2; 496 | } 497 | 498 | enum Option { 499 | NOTIFY_USER_SESSIONS = 0; 500 | NOTIFY_SERVER_SESSIONS = 1; 501 | NOTIFY_ACHIEVEMENTS = 2; 502 | NOTIFY_VAC_ACTION = 3; 503 | } 504 | 505 | repeated csgo.CMsgGCMsgSetOptions.Option options = 1; 506 | repeated csgo.CMsgGCMsgSetOptions.MessageRange client_msg_ranges = 2; 507 | } 508 | 509 | message CMsgGCHUpdateSession { 510 | message ExtraField { 511 | optional string name = 1; 512 | optional string value = 2; 513 | } 514 | 515 | optional fixed64 steam_id = 1; 516 | optional uint32 app_id = 2; 517 | optional bool online = 3; 518 | optional fixed64 server_steam_id = 4; 519 | optional uint32 server_addr = 5; 520 | optional uint32 server_port = 6; 521 | optional uint32 os_type = 7; 522 | optional uint32 client_addr = 8; 523 | repeated csgo.CMsgGCHUpdateSession.ExtraField extra_fields = 9; 524 | optional fixed64 owner_id = 10; 525 | optional uint32 cm_session_sysid = 11; 526 | optional uint32 cm_session_identifier = 12; 527 | repeated uint32 depot_ids = 13; 528 | } 529 | 530 | message CMsgNotificationOfSuspiciousActivity { 531 | message MultipleGameInstances { 532 | optional uint32 app_instance_count = 1; 533 | repeated fixed64 other_steamids = 2; 534 | } 535 | 536 | optional fixed64 steamid = 1; 537 | optional uint32 appid = 2; 538 | optional csgo.CMsgNotificationOfSuspiciousActivity.MultipleGameInstances multiple_instances = 3; 539 | } 540 | 541 | message CMsgDPPartnerMicroTxns { 542 | message PartnerMicroTxn { 543 | optional uint32 init_time = 1; 544 | optional uint32 last_update_time = 2; 545 | optional uint64 txn_id = 3; 546 | optional uint32 account_id = 4; 547 | optional uint32 line_item = 5; 548 | optional uint64 item_id = 6; 549 | optional uint32 def_index = 7; 550 | optional uint64 price = 8; 551 | optional uint64 tax = 9; 552 | optional uint64 price_usd = 10; 553 | optional uint64 tax_usd = 11; 554 | optional uint32 purchase_type = 12; 555 | optional uint32 steam_txn_type = 13; 556 | optional string country_code = 14; 557 | optional string region_code = 15; 558 | optional int32 quantity = 16; 559 | optional uint64 ref_trans_id = 17; 560 | } 561 | 562 | message PartnerInfo { 563 | optional uint32 partner_id = 1; 564 | optional string partner_name = 2; 565 | optional string currency_code = 3; 566 | optional string currency_name = 4; 567 | } 568 | 569 | optional uint32 appid = 1; 570 | optional string gc_name = 2; 571 | optional csgo.CMsgDPPartnerMicroTxns.PartnerInfo partner = 3; 572 | repeated csgo.CMsgDPPartnerMicroTxns.PartnerMicroTxn transactions = 4; 573 | } 574 | 575 | message CMsgDPPartnerMicroTxnsResponse { 576 | enum EErrorCode { 577 | k_MsgValid = 0; 578 | k_MsgInvalidAppID = 1; 579 | k_MsgInvalidPartnerInfo = 2; 580 | k_MsgNoTransactions = 3; 581 | k_MsgSQLFailure = 4; 582 | k_MsgPartnerInfoDiscrepancy = 5; 583 | k_MsgTransactionInsertFailed = 7; 584 | k_MsgAlreadyRunning = 8; 585 | k_MsgInvalidTransactionData = 9; 586 | } 587 | 588 | optional uint32 eresult = 1 [default = 2]; 589 | optional csgo.CMsgDPPartnerMicroTxnsResponse.EErrorCode eerrorcode = 2 [default = k_MsgValid]; 590 | } 591 | 592 | message CChinaAgreementSessions_StartAgreementSessionInGame_Request { 593 | optional uint32 appid = 1; 594 | optional fixed64 steamid = 2; 595 | } 596 | 597 | message CChinaAgreementSessions_StartAgreementSessionInGame_Response { 598 | optional string agreement_url = 1; 599 | } 600 | -------------------------------------------------------------------------------- /csgo/proto_enums.py: -------------------------------------------------------------------------------- 1 | from enum import IntEnum 2 | 3 | class EClientReportingVersion(IntEnum): 4 | OldVersion = 0 5 | BetaVersion = 1 6 | SupportsTrustedMode = 2 7 | 8 | class ECommunityItemAttribute(IntEnum): 9 | Invalid = 0 10 | CardBorder = 1 11 | Level = 2 12 | IssueNumber = 3 13 | TradableTime = 4 14 | StorePackageID = 5 15 | CommunityItemAppID = 6 16 | CommunityItemType = 7 17 | ProfileModiferEnabled = 8 18 | ExpiryTime = 9 19 | 20 | class ECommunityItemClass(IntEnum): 21 | Invalid = 0 22 | Badge = 1 23 | GameCard = 2 24 | ProfileBackground = 3 25 | Emoticon = 4 26 | BoosterPack = 5 27 | Consumable = 6 28 | GameGoo = 7 29 | ProfileModifier = 8 30 | Scene = 9 31 | SalienItem = 10 32 | 33 | class ECsgoGCMsg(IntEnum): 34 | EMsgGCCStrike15_v2_Base = 9100 35 | EMsgGCCStrike15_v2_MatchmakingStart = 9101 36 | EMsgGCCStrike15_v2_MatchmakingStop = 9102 37 | EMsgGCCStrike15_v2_MatchmakingClient2ServerPing = 9103 38 | EMsgGCCStrike15_v2_MatchmakingGC2ClientUpdate = 9104 39 | EMsgGCCStrike15_v2_MatchmakingServerReservationResponse = 9106 40 | EMsgGCCStrike15_v2_MatchmakingGC2ClientReserve = 9107 41 | EMsgGCCStrike15_v2_MatchmakingClient2GCHello = 9109 42 | EMsgGCCStrike15_v2_MatchmakingGC2ClientHello = 9110 43 | EMsgGCCStrike15_v2_MatchmakingGC2ClientAbandon = 9112 44 | EMsgGCCStrike15_v2_MatchmakingGCOperationalStats = 9115 45 | EMsgGCCStrike15_v2_MatchmakingOperator2GCBlogUpdate = 9117 46 | EMsgGCCStrike15_v2_ServerNotificationForUserPenalty = 9118 47 | EMsgGCCStrike15_v2_ClientReportPlayer = 9119 48 | EMsgGCCStrike15_v2_ClientReportServer = 9120 49 | EMsgGCCStrike15_v2_ClientCommendPlayer = 9121 50 | EMsgGCCStrike15_v2_ClientReportResponse = 9122 51 | EMsgGCCStrike15_v2_ClientCommendPlayerQuery = 9123 52 | EMsgGCCStrike15_v2_ClientCommendPlayerQueryResponse = 9124 53 | EMsgGCCStrike15_v2_WatchInfoUsers = 9126 54 | EMsgGCCStrike15_v2_ClientRequestPlayersProfile = 9127 55 | EMsgGCCStrike15_v2_PlayersProfile = 9128 56 | EMsgGCCStrike15_v2_PlayerOverwatchCaseUpdate = 9131 57 | EMsgGCCStrike15_v2_PlayerOverwatchCaseAssignment = 9132 58 | EMsgGCCStrike15_v2_PlayerOverwatchCaseStatus = 9133 59 | EMsgGCCStrike15_v2_GC2ClientTextMsg = 9134 60 | EMsgGCCStrike15_v2_Client2GCTextMsg = 9135 61 | EMsgGCCStrike15_v2_MatchEndRunRewardDrops = 9136 62 | EMsgGCCStrike15_v2_MatchEndRewardDropsNotification = 9137 63 | EMsgGCCStrike15_v2_ClientRequestWatchInfoFriends2 = 9138 64 | EMsgGCCStrike15_v2_MatchList = 9139 65 | EMsgGCCStrike15_v2_MatchListRequestCurrentLiveGames = 9140 66 | EMsgGCCStrike15_v2_MatchListRequestRecentUserGames = 9141 67 | EMsgGCCStrike15_v2_GC2ServerReservationUpdate = 9142 68 | EMsgGCCStrike15_v2_ClientVarValueNotificationInfo = 9144 69 | EMsgGCCStrike15_v2_MatchListRequestTournamentGames = 9146 70 | EMsgGCCStrike15_v2_MatchListRequestFullGameInfo = 9147 71 | EMsgGCCStrike15_v2_GiftsLeaderboardRequest = 9148 72 | EMsgGCCStrike15_v2_GiftsLeaderboardResponse = 9149 73 | EMsgGCCStrike15_v2_ServerVarValueNotificationInfo = 9150 74 | EMsgGCCStrike15_v2_ClientSubmitSurveyVote = 9152 75 | EMsgGCCStrike15_v2_Server2GCClientValidate = 9153 76 | EMsgGCCStrike15_v2_MatchListRequestLiveGameForUser = 9154 77 | EMsgGCCStrike15_v2_Client2GCEconPreviewDataBlockRequest = 9156 78 | EMsgGCCStrike15_v2_Client2GCEconPreviewDataBlockResponse = 9157 79 | EMsgGCCStrike15_v2_AccountPrivacySettings = 9158 80 | EMsgGCCStrike15_v2_SetMyActivityInfo = 9159 81 | EMsgGCCStrike15_v2_MatchListRequestTournamentPredictions = 9160 82 | EMsgGCCStrike15_v2_MatchListUploadTournamentPredictions = 9161 83 | EMsgGCCStrike15_v2_DraftSummary = 9162 84 | EMsgGCCStrike15_v2_ClientRequestJoinFriendData = 9163 85 | EMsgGCCStrike15_v2_ClientRequestJoinServerData = 9164 86 | EMsgGCCStrike15_v2_ClientRequestNewMission = 9165 87 | EMsgGCCStrike15_v2_GC2ClientTournamentInfo = 9167 88 | EMsgGC_GlobalGame_Subscribe = 9168 89 | EMsgGC_GlobalGame_Unsubscribe = 9169 90 | EMsgGC_GlobalGame_Play = 9170 91 | EMsgGCCStrike15_v2_AcknowledgePenalty = 9171 92 | EMsgGCCStrike15_v2_Client2GCRequestPrestigeCoin = 9172 93 | EMsgGCCStrike15_v2_GC2ClientGlobalStats = 9173 94 | EMsgGCCStrike15_v2_Client2GCStreamUnlock = 9174 95 | EMsgGCCStrike15_v2_FantasyRequestClientData = 9175 96 | EMsgGCCStrike15_v2_FantasyUpdateClientData = 9176 97 | EMsgGCCStrike15_v2_GCToClientSteamdatagramTicket = 9177 98 | EMsgGCCStrike15_v2_ClientToGCRequestTicket = 9178 99 | EMsgGCCStrike15_v2_ClientToGCRequestElevate = 9179 100 | EMsgGCCStrike15_v2_GlobalChat = 9180 101 | EMsgGCCStrike15_v2_GlobalChat_Subscribe = 9181 102 | EMsgGCCStrike15_v2_GlobalChat_Unsubscribe = 9182 103 | EMsgGCCStrike15_v2_ClientAuthKeyCode = 9183 104 | EMsgGCCStrike15_v2_GotvSyncPacket = 9184 105 | EMsgGCCStrike15_v2_ClientPlayerDecalSign = 9185 106 | EMsgGCCStrike15_v2_ClientLogonFatalError = 9187 107 | EMsgGCCStrike15_v2_ClientPollState = 9188 108 | EMsgGCCStrike15_v2_Party_Register = 9189 109 | EMsgGCCStrike15_v2_Party_Unregister = 9190 110 | EMsgGCCStrike15_v2_Party_Search = 9191 111 | EMsgGCCStrike15_v2_Party_Invite = 9192 112 | EMsgGCCStrike15_v2_Account_RequestCoPlays = 9193 113 | EMsgGCCStrike15_v2_ClientGCRankUpdate = 9194 114 | EMsgGCCStrike15_v2_ClientRequestOffers = 9195 115 | EMsgGCCStrike15_v2_ClientAccountBalance = 9196 116 | EMsgGCCStrike15_v2_ClientPartyJoinRelay = 9197 117 | EMsgGCCStrike15_v2_ClientPartyWarning = 9198 118 | EMsgGCCStrike15_v2_SetEventFavorite = 9200 119 | EMsgGCCStrike15_v2_GetEventFavorites_Request = 9201 120 | EMsgGCCStrike15_v2_ClientPerfReport = 9202 121 | EMsgGCCStrike15_v2_GetEventFavorites_Response = 9203 122 | EMsgGCCStrike15_v2_ClientRequestSouvenir = 9204 123 | EMsgGCCStrike15_v2_ClientReportValidation = 9205 124 | EMsgGCCStrike15_v2_GC2ClientRefuseSecureMode = 9206 125 | EMsgGCCStrike15_v2_GC2ClientRequestValidation = 9207 126 | EMsgGCCStrike15_v2_ClientRedeemMissionReward = 9209 127 | EMsgGCCStrike15_ClientDeepStats = 9210 128 | EMsgGCCStrike15_StartAgreementSessionInGame = 9211 129 | 130 | class ECsgoSteamUserStat(IntEnum): 131 | XpEarnedGames = 1 132 | MatchWinsCompetitive = 2 133 | SurvivedDangerZone = 3 134 | 135 | class EGCBaseClientMsg(IntEnum): 136 | EMsgGCClientWelcome = 4004 137 | EMsgGCServerWelcome = 4005 138 | EMsgGCClientHello = 4006 139 | EMsgGCServerHello = 4007 140 | EMsgGCClientConnectionStatus = 4009 141 | EMsgGCServerConnectionStatus = 4010 142 | EMsgGCClientHelloPartner = 4011 143 | EMsgGCClientHelloPW = 4012 144 | EMsgGCClientHelloR2 = 4013 145 | EMsgGCClientHelloR3 = 4014 146 | EMsgGCClientHelloR4 = 4015 147 | 148 | class EGCItemCustomizationNotification(IntEnum): 149 | NameItem = 1006 150 | UnlockCrate = 1007 151 | XRayItemReveal = 1008 152 | XRayItemClaim = 1009 153 | CasketTooFull = 1011 154 | CasketContents = 1012 155 | CasketAdded = 1013 156 | CasketRemoved = 1014 157 | CasketInvFull = 1015 158 | NameBaseItem = 1019 159 | RemoveItemName = 1030 160 | RemoveSticker = 1053 161 | ApplySticker = 1086 162 | StatTrakSwap = 1088 163 | RemovePatch = 1089 164 | ApplyPatch = 1090 165 | ActivateFanToken = 9178 166 | ActivateOperationCoin = 9179 167 | GraffitiUnseal = 9185 168 | GenerateSouvenir = 9204 169 | ClientRedeemMissionReward = 9209 170 | 171 | class EGCItemMsg(IntEnum): 172 | EMsgGCBase = 1000 173 | EMsgGCSetItemPosition = 1001 174 | EMsgGCCraft = 1002 175 | EMsgGCCraftResponse = 1003 176 | EMsgGCDelete = 1004 177 | EMsgGCVerifyCacheSubscription = 1005 178 | EMsgGCNameItem = 1006 179 | EMsgGCUnlockCrate = 1007 180 | EMsgGCUnlockCrateResponse = 1008 181 | EMsgGCPaintItem = 1009 182 | EMsgGCPaintItemResponse = 1010 183 | EMsgGCGoldenWrenchBroadcast = 1011 184 | EMsgGCMOTDRequest = 1012 185 | EMsgGCMOTDRequestResponse = 1013 186 | EMsgGCAddItemToSocket_DEPRECATED = 1014 187 | EMsgGCAddItemToSocketResponse_DEPRECATED = 1015 188 | EMsgGCAddSocketToBaseItem_DEPRECATED = 1016 189 | EMsgGCAddSocketToItem_DEPRECATED = 1017 190 | EMsgGCAddSocketToItemResponse_DEPRECATED = 1018 191 | EMsgGCNameBaseItem = 1019 192 | EMsgGCNameBaseItemResponse = 1020 193 | EMsgGCRemoveSocketItem_DEPRECATED = 1021 194 | EMsgGCRemoveSocketItemResponse_DEPRECATED = 1022 195 | EMsgGCCustomizeItemTexture = 1023 196 | EMsgGCCustomizeItemTextureResponse = 1024 197 | EMsgGCUseItemRequest = 1025 198 | EMsgGCUseItemResponse = 1026 199 | EMsgGCGiftedItems_DEPRECATED = 1027 200 | EMsgGCRemoveItemName = 1030 201 | EMsgGCRemoveItemPaint = 1031 202 | EMsgGCGiftWrapItem = 1032 203 | EMsgGCGiftWrapItemResponse = 1033 204 | EMsgGCDeliverGift = 1034 205 | EMsgGCDeliverGiftResponseGiver = 1035 206 | EMsgGCDeliverGiftResponseReceiver = 1036 207 | EMsgGCUnwrapGiftRequest = 1037 208 | EMsgGCUnwrapGiftResponse = 1038 209 | EMsgGCSetItemStyle = 1039 210 | EMsgGCUsedClaimCodeItem = 1040 211 | EMsgGCSortItems = 1041 212 | EMsgGC_RevolvingLootList_DEPRECATED = 1042 213 | EMsgGCLookupAccount = 1043 214 | EMsgGCLookupAccountResponse = 1044 215 | EMsgGCLookupAccountName = 1045 216 | EMsgGCLookupAccountNameResponse = 1046 217 | EMsgGCUpdateItemSchema = 1049 218 | EMsgGCRemoveCustomTexture = 1051 219 | EMsgGCRemoveCustomTextureResponse = 1052 220 | EMsgGCRemoveMakersMark = 1053 221 | EMsgGCRemoveMakersMarkResponse = 1054 222 | EMsgGCRemoveUniqueCraftIndex = 1055 223 | EMsgGCRemoveUniqueCraftIndexResponse = 1056 224 | EMsgGCSaxxyBroadcast = 1057 225 | EMsgGCBackpackSortFinished = 1058 226 | EMsgGCAdjustItemEquippedState = 1059 227 | EMsgGCCollectItem = 1061 228 | EMsgGCItemAcknowledged__DEPRECATED = 1062 229 | EMsgGC_ReportAbuse = 1065 230 | EMsgGC_ReportAbuseResponse = 1066 231 | EMsgGCNameItemNotification = 1068 232 | EMsgGCApplyConsumableEffects = 1069 233 | EMsgGCConsumableExhausted = 1070 234 | EMsgGCShowItemsPickedUp = 1071 235 | EMsgGCClientDisplayNotification = 1072 236 | EMsgGCApplyStrangePart = 1073 237 | EMsgGC_IncrementKillCountAttribute = 1074 238 | EMsgGC_IncrementKillCountResponse = 1075 239 | EMsgGCApplyPennantUpgrade = 1076 240 | EMsgGCSetItemPositions = 1077 241 | EMsgGCApplyEggEssence = 1078 242 | EMsgGCNameEggEssenceResponse = 1079 243 | EMsgGCPaintKitItem = 1080 244 | EMsgGCPaintKitBaseItem = 1081 245 | EMsgGCPaintKitItemResponse = 1082 246 | EMsgGCGiftedItems = 1083 247 | EMsgGCUnlockItemStyle = 1084 248 | EMsgGCUnlockItemStyleResponse = 1085 249 | EMsgGCApplySticker = 1086 250 | EMsgGCItemAcknowledged = 1087 251 | EMsgGCStatTrakSwap = 1088 252 | EMsgGCUserTrackTimePlayedConsecutively = 1089 253 | EMsgGCItemCustomizationNotification = 1090 254 | EMsgGCModifyItemAttribute = 1091 255 | EMsgGCCasketItemAdd = 1092 256 | EMsgGCCasketItemExtract = 1093 257 | EMsgGCCasketItemLoadContents = 1094 258 | EMsgGCTradingBase = 1500 259 | EMsgGCTrading_InitiateTradeRequest = 1501 260 | EMsgGCTrading_InitiateTradeResponse = 1502 261 | EMsgGCTrading_StartSession = 1503 262 | EMsgGCTrading_SetItem = 1504 263 | EMsgGCTrading_RemoveItem = 1505 264 | EMsgGCTrading_UpdateTradeInfo = 1506 265 | EMsgGCTrading_SetReadiness = 1507 266 | EMsgGCTrading_ReadinessResponse = 1508 267 | EMsgGCTrading_SessionClosed = 1509 268 | EMsgGCTrading_CancelSession = 1510 269 | EMsgGCTrading_TradeChatMsg = 1511 270 | EMsgGCTrading_ConfirmOffer = 1512 271 | EMsgGCTrading_TradeTypingChatMsg = 1513 272 | EMsgGCServerBrowser_FavoriteServer = 1601 273 | EMsgGCServerBrowser_BlacklistServer = 1602 274 | EMsgGCServerRentalsBase = 1700 275 | EMsgGCItemPreviewCheckStatus = 1701 276 | EMsgGCItemPreviewStatusResponse = 1702 277 | EMsgGCItemPreviewRequest = 1703 278 | EMsgGCItemPreviewRequestResponse = 1704 279 | EMsgGCItemPreviewExpire = 1705 280 | EMsgGCItemPreviewExpireNotification = 1706 281 | EMsgGCItemPreviewItemBoughtNotification = 1707 282 | EMsgGCDev_NewItemRequest = 2001 283 | EMsgGCDev_NewItemRequestResponse = 2002 284 | EMsgGCDev_PaintKitDropItem = 2003 285 | EMsgGCStoreGetUserData = 2500 286 | EMsgGCStoreGetUserDataResponse = 2501 287 | EMsgGCStorePurchaseInit_DEPRECATED = 2502 288 | EMsgGCStorePurchaseInitResponse_DEPRECATED = 2503 289 | EMsgGCStorePurchaseFinalize = 2504 290 | EMsgGCStorePurchaseFinalizeResponse = 2505 291 | EMsgGCStorePurchaseCancel = 2506 292 | EMsgGCStorePurchaseCancelResponse = 2507 293 | EMsgGCStorePurchaseQueryTxn = 2508 294 | EMsgGCStorePurchaseQueryTxnResponse = 2509 295 | EMsgGCStorePurchaseInit = 2510 296 | EMsgGCStorePurchaseInitResponse = 2511 297 | EMsgGCBannedWordListRequest = 2512 298 | EMsgGCBannedWordListResponse = 2513 299 | EMsgGCToGCBannedWordListBroadcast = 2514 300 | EMsgGCToGCBannedWordListUpdated = 2515 301 | EMsgGCToGCDirtySDOCache = 2516 302 | EMsgGCToGCDirtyMultipleSDOCache = 2517 303 | EMsgGCToGCUpdateSQLKeyValue = 2518 304 | EMsgGCToGCIsTrustedServer = 2519 305 | EMsgGCToGCIsTrustedServerResponse = 2520 306 | EMsgGCToGCBroadcastConsoleCommand = 2521 307 | EMsgGCServerVersionUpdated = 2522 308 | EMsgGCApplyAutograph = 2523 309 | EMsgGCToGCWebAPIAccountChanged = 2524 310 | EMsgGCRequestAnnouncements = 2525 311 | EMsgGCRequestAnnouncementsResponse = 2526 312 | EMsgGCRequestPassportItemGrant = 2527 313 | EMsgGCClientVersionUpdated = 2528 314 | EMsgGCAdjustItemEquippedStateMulti = 2529 315 | 316 | class EGCMsgResponse(IntEnum): 317 | EGCMsgResponseOK = 0 318 | EGCMsgResponseDenied = 1 319 | EGCMsgResponseServerError = 2 320 | EGCMsgResponseTimeout = 3 321 | EGCMsgResponseInvalid = 4 322 | EGCMsgResponseNoMatch = 5 323 | EGCMsgResponseUnknownError = 6 324 | EGCMsgResponseNotLoggedOn = 7 325 | EGCMsgFailedToCreate = 8 326 | EGCMsgLimitExceeded = 9 327 | EGCMsgCommitUnfinalized = 10 328 | 329 | class EGCSystemMsg(IntEnum): 330 | EGCMsgInvalid = 0 331 | EGCMsgMulti = 1 332 | EGCMsgGenericReply = 10 333 | EGCMsgSystemBase = 50 334 | EGCMsgAchievementAwarded = 51 335 | EGCMsgConCommand = 52 336 | EGCMsgStartPlaying = 53 337 | EGCMsgStopPlaying = 54 338 | EGCMsgStartGameserver = 55 339 | EGCMsgStopGameserver = 56 340 | EGCMsgWGRequest = 57 341 | EGCMsgWGResponse = 58 342 | EGCMsgGetUserGameStatsSchema = 59 343 | EGCMsgGetUserGameStatsSchemaResponse = 60 344 | EGCMsgGetUserStatsDEPRECATED = 61 345 | EGCMsgGetUserStatsResponse = 62 346 | EGCMsgAppInfoUpdated = 63 347 | EGCMsgValidateSession = 64 348 | EGCMsgValidateSessionResponse = 65 349 | EGCMsgLookupAccountFromInput = 66 350 | EGCMsgSendHTTPRequest = 67 351 | EGCMsgSendHTTPRequestResponse = 68 352 | EGCMsgPreTestSetup = 69 353 | EGCMsgRecordSupportAction = 70 354 | EGCMsgGetAccountDetails_DEPRECATED = 71 355 | EGCMsgReceiveInterAppMessage = 73 356 | EGCMsgFindAccounts = 74 357 | EGCMsgPostAlert = 75 358 | EGCMsgGetLicenses = 76 359 | EGCMsgGetUserStats = 77 360 | EGCMsgGetCommands = 78 361 | EGCMsgGetCommandsResponse = 79 362 | EGCMsgAddFreeLicense = 80 363 | EGCMsgAddFreeLicenseResponse = 81 364 | EGCMsgGetIPLocation = 82 365 | EGCMsgGetIPLocationResponse = 83 366 | EGCMsgSystemStatsSchema = 84 367 | EGCMsgGetSystemStats = 85 368 | EGCMsgGetSystemStatsResponse = 86 369 | EGCMsgSendEmail = 87 370 | EGCMsgSendEmailResponse = 88 371 | EGCMsgGetEmailTemplate = 89 372 | EGCMsgGetEmailTemplateResponse = 90 373 | EGCMsgGrantGuestPass = 91 374 | EGCMsgGrantGuestPassResponse = 92 375 | EGCMsgGetAccountDetails = 93 376 | EGCMsgGetAccountDetailsResponse = 94 377 | EGCMsgGetPersonaNames = 95 378 | EGCMsgGetPersonaNamesResponse = 96 379 | EGCMsgMultiplexMsg = 97 380 | EGCMsgMultiplexMsgResponse = 98 381 | EGCMsgWebAPIRegisterInterfaces = 101 382 | EGCMsgWebAPIJobRequest = 102 383 | EGCMsgWebAPIJobRequestHttpResponse = 104 384 | EGCMsgWebAPIJobRequestForwardResponse = 105 385 | EGCMsgMemCachedGet = 200 386 | EGCMsgMemCachedGetResponse = 201 387 | EGCMsgMemCachedSet = 202 388 | EGCMsgMemCachedDelete = 203 389 | EGCMsgMemCachedStats = 204 390 | EGCMsgMemCachedStatsResponse = 205 391 | EGCMsgMasterSetDirectory = 220 392 | EGCMsgMasterSetDirectoryResponse = 221 393 | EGCMsgMasterSetWebAPIRouting = 222 394 | EGCMsgMasterSetWebAPIRoutingResponse = 223 395 | EGCMsgMasterSetClientMsgRouting = 224 396 | EGCMsgMasterSetClientMsgRoutingResponse = 225 397 | EGCMsgSetOptions = 226 398 | EGCMsgSetOptionsResponse = 227 399 | EGCMsgSystemBase2 = 500 400 | EGCMsgGetPurchaseTrustStatus = 501 401 | EGCMsgGetPurchaseTrustStatusResponse = 502 402 | EGCMsgUpdateSession = 503 403 | EGCMsgGCAccountVacStatusChange = 504 404 | EGCMsgCheckFriendship = 505 405 | EGCMsgCheckFriendshipResponse = 506 406 | EGCMsgGetPartnerAccountLink = 507 407 | EGCMsgGetPartnerAccountLinkResponse = 508 408 | EGCMsgDPPartnerMicroTxns = 512 409 | EGCMsgDPPartnerMicroTxnsResponse = 513 410 | EGCMsgVacVerificationChange = 518 411 | EGCMsgAccountPhoneNumberChange = 519 412 | EGCMsgInviteUserToLobby = 523 413 | EGCMsgGetGamePersonalDataCategoriesRequest = 524 414 | EGCMsgGetGamePersonalDataCategoriesResponse = 525 415 | EGCMsgGetGamePersonalDataEntriesRequest = 526 416 | EGCMsgGetGamePersonalDataEntriesResponse = 527 417 | EGCMsgTerminateGamePersonalDataEntriesRequest = 528 418 | EGCMsgTerminateGamePersonalDataEntriesResponse = 529 419 | 420 | class EGCToGCMsg(IntEnum): 421 | EGCToGCMsgMasterAck = 150 422 | EGCToGCMsgMasterAckResponse = 151 423 | EGCToGCMsgRouted = 152 424 | EGCToGCMsgRoutedReply = 153 425 | EMsgUpdateSessionIP = 154 426 | EMsgRequestSessionIP = 155 427 | EMsgRequestSessionIPResponse = 156 428 | EGCToGCMsgMasterStartupComplete = 157 429 | 430 | class ESOMsg(IntEnum): 431 | Create = 21 432 | Update = 22 433 | Destroy = 23 434 | CacheSubscribed = 24 435 | CacheUnsubscribed = 25 436 | UpdateMultiple = 26 437 | CacheSubscriptionCheck = 27 438 | CacheSubscriptionRefresh = 28 439 | 440 | class EUnlockStyle(IntEnum): 441 | UnlockStyle_Succeeded = 0 442 | UnlockStyle_Failed_PreReq = 1 443 | UnlockStyle_Failed_CantAfford = 2 444 | UnlockStyle_Failed_CantCommit = 3 445 | UnlockStyle_Failed_CantLockCache = 4 446 | UnlockStyle_Failed_CantAffordAttrib = 5 447 | 448 | class GCClientLauncherType(IntEnum): 449 | DEFAULT = 0 450 | PERFECTWORLD = 1 451 | STEAMCHINA = 2 452 | 453 | class GCConnectionStatus(IntEnum): 454 | HAVE_SESSION = 0 455 | GC_GOING_DOWN = 1 456 | NO_SESSION = 2 457 | NO_SESSION_IN_LOGON_QUEUE = 3 458 | NO_STEAM = 4 459 | 460 | __all__ = [ 461 | 'EClientReportingVersion', 462 | 'ECommunityItemAttribute', 463 | 'ECommunityItemClass', 464 | 'ECsgoGCMsg', 465 | 'ECsgoSteamUserStat', 466 | 'EGCBaseClientMsg', 467 | 'EGCItemCustomizationNotification', 468 | 'EGCItemMsg', 469 | 'EGCMsgResponse', 470 | 'EGCSystemMsg', 471 | 'EGCToGCMsg', 472 | 'ESOMsg', 473 | 'EUnlockStyle', 474 | 'GCClientLauncherType', 475 | 'GCConnectionStatus', 476 | ] 477 | -------------------------------------------------------------------------------- /protobufs/google/protobuf/descriptor.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // The messages in this file describe the definitions found in .proto files. 36 | // A valid .proto file can be translated directly to a FileDescriptorProto 37 | // without any other information (e.g. without reading its imports). 38 | 39 | 40 | syntax = "proto2"; 41 | 42 | package google.protobuf; 43 | option go_package = "descriptor"; 44 | option java_package = "com.google.protobuf"; 45 | option java_outer_classname = "DescriptorProtos"; 46 | option csharp_namespace = "Google.Protobuf.Reflection"; 47 | option objc_class_prefix = "GPB"; 48 | 49 | // descriptor.proto must be optimized for speed because reflection-based 50 | // algorithms don't work during bootstrapping. 51 | option optimize_for = SPEED; 52 | 53 | // The protocol compiler can output a FileDescriptorSet containing the .proto 54 | // files it parses. 55 | message FileDescriptorSet { 56 | repeated FileDescriptorProto file = 1; 57 | } 58 | 59 | // Describes a complete .proto file. 60 | message FileDescriptorProto { 61 | optional string name = 1; // file name, relative to root of source tree 62 | optional string package = 2; // e.g. "foo", "foo.bar", etc. 63 | 64 | // Names of files imported by this file. 65 | repeated string dependency = 3; 66 | // Indexes of the public imported files in the dependency list above. 67 | repeated int32 public_dependency = 10; 68 | // Indexes of the weak imported files in the dependency list. 69 | // For Google-internal migration only. Do not use. 70 | repeated int32 weak_dependency = 11; 71 | 72 | // All top-level definitions in this file. 73 | repeated DescriptorProto message_type = 4; 74 | repeated EnumDescriptorProto enum_type = 5; 75 | repeated ServiceDescriptorProto service = 6; 76 | repeated FieldDescriptorProto extension = 7; 77 | 78 | optional FileOptions options = 8; 79 | 80 | // This field contains optional information about the original source code. 81 | // You may safely remove this entire field without harming runtime 82 | // functionality of the descriptors -- the information is needed only by 83 | // development tools. 84 | optional SourceCodeInfo source_code_info = 9; 85 | 86 | // The syntax of the proto file. 87 | // The supported values are "proto2" and "proto3". 88 | optional string syntax = 12; 89 | } 90 | 91 | // Describes a message type. 92 | message DescriptorProto { 93 | optional string name = 1; 94 | 95 | repeated FieldDescriptorProto field = 2; 96 | repeated FieldDescriptorProto extension = 6; 97 | 98 | repeated DescriptorProto nested_type = 3; 99 | repeated EnumDescriptorProto enum_type = 4; 100 | 101 | message ExtensionRange { 102 | optional int32 start = 1; 103 | optional int32 end = 2; 104 | } 105 | repeated ExtensionRange extension_range = 5; 106 | 107 | repeated OneofDescriptorProto oneof_decl = 8; 108 | 109 | optional MessageOptions options = 7; 110 | 111 | // Range of reserved tag numbers. Reserved tag numbers may not be used by 112 | // fields or extension ranges in the same message. Reserved ranges may 113 | // not overlap. 114 | message ReservedRange { 115 | optional int32 start = 1; // Inclusive. 116 | optional int32 end = 2; // Exclusive. 117 | } 118 | repeated ReservedRange reserved_range = 9; 119 | // Reserved field names, which may not be used by fields in the same message. 120 | // A given name may only be reserved once. 121 | repeated string reserved_name = 10; 122 | } 123 | 124 | // Describes a field within a message. 125 | message FieldDescriptorProto { 126 | enum Type { 127 | // 0 is reserved for errors. 128 | // Order is weird for historical reasons. 129 | TYPE_DOUBLE = 1; 130 | TYPE_FLOAT = 2; 131 | // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if 132 | // negative values are likely. 133 | TYPE_INT64 = 3; 134 | TYPE_UINT64 = 4; 135 | // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if 136 | // negative values are likely. 137 | TYPE_INT32 = 5; 138 | TYPE_FIXED64 = 6; 139 | TYPE_FIXED32 = 7; 140 | TYPE_BOOL = 8; 141 | TYPE_STRING = 9; 142 | TYPE_GROUP = 10; // Tag-delimited aggregate. 143 | TYPE_MESSAGE = 11; // Length-delimited aggregate. 144 | 145 | // New in version 2. 146 | TYPE_BYTES = 12; 147 | TYPE_UINT32 = 13; 148 | TYPE_ENUM = 14; 149 | TYPE_SFIXED32 = 15; 150 | TYPE_SFIXED64 = 16; 151 | TYPE_SINT32 = 17; // Uses ZigZag encoding. 152 | TYPE_SINT64 = 18; // Uses ZigZag encoding. 153 | }; 154 | 155 | enum Label { 156 | // 0 is reserved for errors 157 | LABEL_OPTIONAL = 1; 158 | LABEL_REQUIRED = 2; 159 | LABEL_REPEATED = 3; 160 | // TODO(sanjay): Should we add LABEL_MAP? 161 | }; 162 | 163 | optional string name = 1; 164 | optional int32 number = 3; 165 | optional Label label = 4; 166 | 167 | // If type_name is set, this need not be set. If both this and type_name 168 | // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. 169 | optional Type type = 5; 170 | 171 | // For message and enum types, this is the name of the type. If the name 172 | // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping 173 | // rules are used to find the type (i.e. first the nested types within this 174 | // message are searched, then within the parent, on up to the root 175 | // namespace). 176 | optional string type_name = 6; 177 | 178 | // For extensions, this is the name of the type being extended. It is 179 | // resolved in the same manner as type_name. 180 | optional string extendee = 2; 181 | 182 | // For numeric types, contains the original text representation of the value. 183 | // For booleans, "true" or "false". 184 | // For strings, contains the default text contents (not escaped in any way). 185 | // For bytes, contains the C escaped value. All bytes >= 128 are escaped. 186 | // TODO(kenton): Base-64 encode? 187 | optional string default_value = 7; 188 | 189 | // If set, gives the index of a oneof in the containing type's oneof_decl 190 | // list. This field is a member of that oneof. 191 | optional int32 oneof_index = 9; 192 | 193 | // JSON name of this field. The value is set by protocol compiler. If the 194 | // user has set a "json_name" option on this field, that option's value 195 | // will be used. Otherwise, it's deduced from the field's name by converting 196 | // it to camelCase. 197 | optional string json_name = 10; 198 | 199 | optional FieldOptions options = 8; 200 | } 201 | 202 | // Describes a oneof. 203 | message OneofDescriptorProto { 204 | optional string name = 1; 205 | } 206 | 207 | // Describes an enum type. 208 | message EnumDescriptorProto { 209 | optional string name = 1; 210 | 211 | repeated EnumValueDescriptorProto value = 2; 212 | 213 | optional EnumOptions options = 3; 214 | } 215 | 216 | // Describes a value within an enum. 217 | message EnumValueDescriptorProto { 218 | optional string name = 1; 219 | optional int32 number = 2; 220 | 221 | optional EnumValueOptions options = 3; 222 | } 223 | 224 | // Describes a service. 225 | message ServiceDescriptorProto { 226 | optional string name = 1; 227 | repeated MethodDescriptorProto method = 2; 228 | 229 | optional ServiceOptions options = 3; 230 | } 231 | 232 | // Describes a method of a service. 233 | message MethodDescriptorProto { 234 | optional string name = 1; 235 | 236 | // Input and output type names. These are resolved in the same way as 237 | // FieldDescriptorProto.type_name, but must refer to a message type. 238 | optional string input_type = 2; 239 | optional string output_type = 3; 240 | 241 | optional MethodOptions options = 4; 242 | 243 | // Identifies if client streams multiple client messages 244 | optional bool client_streaming = 5 [default=false]; 245 | // Identifies if server streams multiple server messages 246 | optional bool server_streaming = 6 [default=false]; 247 | } 248 | 249 | 250 | // =================================================================== 251 | // Options 252 | 253 | // Each of the definitions above may have "options" attached. These are 254 | // just annotations which may cause code to be generated slightly differently 255 | // or may contain hints for code that manipulates protocol messages. 256 | // 257 | // Clients may define custom options as extensions of the *Options messages. 258 | // These extensions may not yet be known at parsing time, so the parser cannot 259 | // store the values in them. Instead it stores them in a field in the *Options 260 | // message called uninterpreted_option. This field must have the same name 261 | // across all *Options messages. We then use this field to populate the 262 | // extensions when we build a descriptor, at which point all protos have been 263 | // parsed and so all extensions are known. 264 | // 265 | // Extension numbers for custom options may be chosen as follows: 266 | // * For options which will only be used within a single application or 267 | // organization, or for experimental options, use field numbers 50000 268 | // through 99999. It is up to you to ensure that you do not use the 269 | // same number for multiple options. 270 | // * For options which will be published and used publicly by multiple 271 | // independent entities, e-mail protobuf-global-extension-registry@google.com 272 | // to reserve extension numbers. Simply provide your project name (e.g. 273 | // Objective-C plugin) and your project website (if available) -- there's no 274 | // need to explain how you intend to use them. Usually you only need one 275 | // extension number. You can declare multiple options with only one extension 276 | // number by putting them in a sub-message. See the Custom Options section of 277 | // the docs for examples: 278 | // https://developers.google.com/protocol-buffers/docs/proto#options 279 | // If this turns out to be popular, a web service will be set up 280 | // to automatically assign option numbers. 281 | 282 | 283 | message FileOptions { 284 | 285 | // Sets the Java package where classes generated from this .proto will be 286 | // placed. By default, the proto package is used, but this is often 287 | // inappropriate because proto packages do not normally start with backwards 288 | // domain names. 289 | optional string java_package = 1; 290 | 291 | 292 | // If set, all the classes from the .proto file are wrapped in a single 293 | // outer class with the given name. This applies to both Proto1 294 | // (equivalent to the old "--one_java_file" option) and Proto2 (where 295 | // a .proto always translates to a single class, but you may want to 296 | // explicitly choose the class name). 297 | optional string java_outer_classname = 8; 298 | 299 | // If set true, then the Java code generator will generate a separate .java 300 | // file for each top-level message, enum, and service defined in the .proto 301 | // file. Thus, these types will *not* be nested inside the outer class 302 | // named by java_outer_classname. However, the outer class will still be 303 | // generated to contain the file's getDescriptor() method as well as any 304 | // top-level extensions defined in the file. 305 | optional bool java_multiple_files = 10 [default=false]; 306 | 307 | // If set true, then the Java code generator will generate equals() and 308 | // hashCode() methods for all messages defined in the .proto file. 309 | // This increases generated code size, potentially substantially for large 310 | // protos, which may harm a memory-constrained application. 311 | // - In the full runtime this is a speed optimization, as the 312 | // AbstractMessage base class includes reflection-based implementations of 313 | // these methods. 314 | // - In the lite runtime, setting this option changes the semantics of 315 | // equals() and hashCode() to more closely match those of the full runtime; 316 | // the generated methods compute their results based on field values rather 317 | // than object identity. (Implementations should not assume that hashcodes 318 | // will be consistent across runtimes or versions of the protocol compiler.) 319 | optional bool java_generate_equals_and_hash = 20 [default=false]; 320 | 321 | // If set true, then the Java2 code generator will generate code that 322 | // throws an exception whenever an attempt is made to assign a non-UTF-8 323 | // byte sequence to a string field. 324 | // Message reflection will do the same. 325 | // However, an extension field still accepts non-UTF-8 byte sequences. 326 | // This option has no effect on when used with the lite runtime. 327 | optional bool java_string_check_utf8 = 27 [default=false]; 328 | 329 | 330 | // Generated classes can be optimized for speed or code size. 331 | enum OptimizeMode { 332 | SPEED = 1; // Generate complete code for parsing, serialization, 333 | // etc. 334 | CODE_SIZE = 2; // Use ReflectionOps to implement these methods. 335 | LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. 336 | } 337 | optional OptimizeMode optimize_for = 9 [default=SPEED]; 338 | 339 | // Sets the Go package where structs generated from this .proto will be 340 | // placed. If omitted, the Go package will be derived from the following: 341 | // - The basename of the package import path, if provided. 342 | // - Otherwise, the package statement in the .proto file, if present. 343 | // - Otherwise, the basename of the .proto file, without extension. 344 | optional string go_package = 11; 345 | 346 | 347 | 348 | // Should generic services be generated in each language? "Generic" services 349 | // are not specific to any particular RPC system. They are generated by the 350 | // main code generators in each language (without additional plugins). 351 | // Generic services were the only kind of service generation supported by 352 | // early versions of google.protobuf. 353 | // 354 | // Generic services are now considered deprecated in favor of using plugins 355 | // that generate code specific to your particular RPC system. Therefore, 356 | // these default to false. Old code which depends on generic services should 357 | // explicitly set them to true. 358 | optional bool cc_generic_services = 16 [default=false]; 359 | optional bool java_generic_services = 17 [default=false]; 360 | optional bool py_generic_services = 18 [default=false]; 361 | 362 | // Is this file deprecated? 363 | // Depending on the target platform, this can emit Deprecated annotations 364 | // for everything in the file, or it will be completely ignored; in the very 365 | // least, this is a formalization for deprecating files. 366 | optional bool deprecated = 23 [default=false]; 367 | 368 | // Enables the use of arenas for the proto messages in this file. This applies 369 | // only to generated classes for C++. 370 | optional bool cc_enable_arenas = 31 [default=false]; 371 | 372 | 373 | // Sets the objective c class prefix which is prepended to all objective c 374 | // generated classes from this .proto. There is no default. 375 | optional string objc_class_prefix = 36; 376 | 377 | // Namespace for generated classes; defaults to the package. 378 | optional string csharp_namespace = 37; 379 | 380 | // Whether the nano proto compiler should generate in the deprecated non-nano 381 | // suffixed package. 382 | optional bool javanano_use_deprecated_package = 38 [deprecated = true]; 383 | 384 | // The parser stores options it doesn't recognize here. See above. 385 | repeated UninterpretedOption uninterpreted_option = 999; 386 | 387 | // Clients can define custom options in extensions of this message. See above. 388 | extensions 1000 to max; 389 | } 390 | 391 | message MessageOptions { 392 | // Set true to use the old proto1 MessageSet wire format for extensions. 393 | // This is provided for backwards-compatibility with the MessageSet wire 394 | // format. You should not use this for any other reason: It's less 395 | // efficient, has fewer features, and is more complicated. 396 | // 397 | // The message must be defined exactly as follows: 398 | // message Foo { 399 | // option message_set_wire_format = true; 400 | // extensions 4 to max; 401 | // } 402 | // Note that the message cannot have any defined fields; MessageSets only 403 | // have extensions. 404 | // 405 | // All extensions of your type must be singular messages; e.g. they cannot 406 | // be int32s, enums, or repeated messages. 407 | // 408 | // Because this is an option, the above two restrictions are not enforced by 409 | // the protocol compiler. 410 | optional bool message_set_wire_format = 1 [default=false]; 411 | 412 | // Disables the generation of the standard "descriptor()" accessor, which can 413 | // conflict with a field of the same name. This is meant to make migration 414 | // from proto1 easier; new code should avoid fields named "descriptor". 415 | optional bool no_standard_descriptor_accessor = 2 [default=false]; 416 | 417 | // Is this message deprecated? 418 | // Depending on the target platform, this can emit Deprecated annotations 419 | // for the message, or it will be completely ignored; in the very least, 420 | // this is a formalization for deprecating messages. 421 | optional bool deprecated = 3 [default=false]; 422 | 423 | // Whether the message is an automatically generated map entry type for the 424 | // maps field. 425 | // 426 | // For maps fields: 427 | // map map_field = 1; 428 | // The parsed descriptor looks like: 429 | // message MapFieldEntry { 430 | // option map_entry = true; 431 | // optional KeyType key = 1; 432 | // optional ValueType value = 2; 433 | // } 434 | // repeated MapFieldEntry map_field = 1; 435 | // 436 | // Implementations may choose not to generate the map_entry=true message, but 437 | // use a native map in the target language to hold the keys and values. 438 | // The reflection APIs in such implementions still need to work as 439 | // if the field is a repeated message field. 440 | // 441 | // NOTE: Do not set the option in .proto files. Always use the maps syntax 442 | // instead. The option should only be implicitly set by the proto compiler 443 | // parser. 444 | optional bool map_entry = 7; 445 | 446 | // The parser stores options it doesn't recognize here. See above. 447 | repeated UninterpretedOption uninterpreted_option = 999; 448 | 449 | // Clients can define custom options in extensions of this message. See above. 450 | extensions 1000 to max; 451 | } 452 | 453 | message FieldOptions { 454 | // The ctype option instructs the C++ code generator to use a different 455 | // representation of the field than it normally would. See the specific 456 | // options below. This option is not yet implemented in the open source 457 | // release -- sorry, we'll try to include it in a future version! 458 | optional CType ctype = 1 [default = STRING]; 459 | enum CType { 460 | // Default mode. 461 | STRING = 0; 462 | 463 | CORD = 1; 464 | 465 | STRING_PIECE = 2; 466 | } 467 | // The packed option can be enabled for repeated primitive fields to enable 468 | // a more efficient representation on the wire. Rather than repeatedly 469 | // writing the tag and type for each element, the entire array is encoded as 470 | // a single length-delimited blob. In proto3, only explicit setting it to 471 | // false will avoid using packed encoding. 472 | optional bool packed = 2; 473 | 474 | 475 | // The jstype option determines the JavaScript type used for values of the 476 | // field. The option is permitted only for 64 bit integral and fixed types 477 | // (int64, uint64, sint64, fixed64, sfixed64). By default these types are 478 | // represented as JavaScript strings. This avoids loss of precision that can 479 | // happen when a large value is converted to a floating point JavaScript 480 | // numbers. Specifying JS_NUMBER for the jstype causes the generated 481 | // JavaScript code to use the JavaScript "number" type instead of strings. 482 | // This option is an enum to permit additional types to be added, 483 | // e.g. goog.math.Integer. 484 | optional JSType jstype = 6 [default = JS_NORMAL]; 485 | enum JSType { 486 | // Use the default type. 487 | JS_NORMAL = 0; 488 | 489 | // Use JavaScript strings. 490 | JS_STRING = 1; 491 | 492 | // Use JavaScript numbers. 493 | JS_NUMBER = 2; 494 | } 495 | 496 | // Should this field be parsed lazily? Lazy applies only to message-type 497 | // fields. It means that when the outer message is initially parsed, the 498 | // inner message's contents will not be parsed but instead stored in encoded 499 | // form. The inner message will actually be parsed when it is first accessed. 500 | // 501 | // This is only a hint. Implementations are free to choose whether to use 502 | // eager or lazy parsing regardless of the value of this option. However, 503 | // setting this option true suggests that the protocol author believes that 504 | // using lazy parsing on this field is worth the additional bookkeeping 505 | // overhead typically needed to implement it. 506 | // 507 | // This option does not affect the public interface of any generated code; 508 | // all method signatures remain the same. Furthermore, thread-safety of the 509 | // interface is not affected by this option; const methods remain safe to 510 | // call from multiple threads concurrently, while non-const methods continue 511 | // to require exclusive access. 512 | // 513 | // 514 | // Note that implementations may choose not to check required fields within 515 | // a lazy sub-message. That is, calling IsInitialized() on the outher message 516 | // may return true even if the inner message has missing required fields. 517 | // This is necessary because otherwise the inner message would have to be 518 | // parsed in order to perform the check, defeating the purpose of lazy 519 | // parsing. An implementation which chooses not to check required fields 520 | // must be consistent about it. That is, for any particular sub-message, the 521 | // implementation must either *always* check its required fields, or *never* 522 | // check its required fields, regardless of whether or not the message has 523 | // been parsed. 524 | optional bool lazy = 5 [default=false]; 525 | 526 | // Is this field deprecated? 527 | // Depending on the target platform, this can emit Deprecated annotations 528 | // for accessors, or it will be completely ignored; in the very least, this 529 | // is a formalization for deprecating fields. 530 | optional bool deprecated = 3 [default=false]; 531 | 532 | // For Google-internal migration only. Do not use. 533 | optional bool weak = 10 [default=false]; 534 | 535 | 536 | // The parser stores options it doesn't recognize here. See above. 537 | repeated UninterpretedOption uninterpreted_option = 999; 538 | 539 | // Clients can define custom options in extensions of this message. See above. 540 | extensions 1000 to max; 541 | } 542 | 543 | message EnumOptions { 544 | 545 | // Set this option to true to allow mapping different tag names to the same 546 | // value. 547 | optional bool allow_alias = 2; 548 | 549 | // Is this enum deprecated? 550 | // Depending on the target platform, this can emit Deprecated annotations 551 | // for the enum, or it will be completely ignored; in the very least, this 552 | // is a formalization for deprecating enums. 553 | optional bool deprecated = 3 [default=false]; 554 | 555 | // The parser stores options it doesn't recognize here. See above. 556 | repeated UninterpretedOption uninterpreted_option = 999; 557 | 558 | // Clients can define custom options in extensions of this message. See above. 559 | extensions 1000 to max; 560 | } 561 | 562 | message EnumValueOptions { 563 | // Is this enum value deprecated? 564 | // Depending on the target platform, this can emit Deprecated annotations 565 | // for the enum value, or it will be completely ignored; in the very least, 566 | // this is a formalization for deprecating enum values. 567 | optional bool deprecated = 1 [default=false]; 568 | 569 | // The parser stores options it doesn't recognize here. See above. 570 | repeated UninterpretedOption uninterpreted_option = 999; 571 | 572 | // Clients can define custom options in extensions of this message. See above. 573 | extensions 1000 to max; 574 | } 575 | 576 | message ServiceOptions { 577 | 578 | // Note: Field numbers 1 through 32 are reserved for Google's internal RPC 579 | // framework. We apologize for hoarding these numbers to ourselves, but 580 | // we were already using them long before we decided to release Protocol 581 | // Buffers. 582 | 583 | // Is this service deprecated? 584 | // Depending on the target platform, this can emit Deprecated annotations 585 | // for the service, or it will be completely ignored; in the very least, 586 | // this is a formalization for deprecating services. 587 | optional bool deprecated = 33 [default=false]; 588 | 589 | // The parser stores options it doesn't recognize here. See above. 590 | repeated UninterpretedOption uninterpreted_option = 999; 591 | 592 | // Clients can define custom options in extensions of this message. See above. 593 | extensions 1000 to max; 594 | } 595 | 596 | message MethodOptions { 597 | 598 | // Note: Field numbers 1 through 32 are reserved for Google's internal RPC 599 | // framework. We apologize for hoarding these numbers to ourselves, but 600 | // we were already using them long before we decided to release Protocol 601 | // Buffers. 602 | 603 | // Is this method deprecated? 604 | // Depending on the target platform, this can emit Deprecated annotations 605 | // for the method, or it will be completely ignored; in the very least, 606 | // this is a formalization for deprecating methods. 607 | optional bool deprecated = 33 [default=false]; 608 | 609 | // The parser stores options it doesn't recognize here. See above. 610 | repeated UninterpretedOption uninterpreted_option = 999; 611 | 612 | // Clients can define custom options in extensions of this message. See above. 613 | extensions 1000 to max; 614 | } 615 | 616 | 617 | // A message representing a option the parser does not recognize. This only 618 | // appears in options protos created by the compiler::Parser class. 619 | // DescriptorPool resolves these when building Descriptor objects. Therefore, 620 | // options protos in descriptor objects (e.g. returned by Descriptor::options(), 621 | // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions 622 | // in them. 623 | message UninterpretedOption { 624 | // The name of the uninterpreted option. Each string represents a segment in 625 | // a dot-separated name. is_extension is true iff a segment represents an 626 | // extension (denoted with parentheses in options specs in .proto files). 627 | // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents 628 | // "foo.(bar.baz).qux". 629 | message NamePart { 630 | required string name_part = 1; 631 | required bool is_extension = 2; 632 | } 633 | repeated NamePart name = 2; 634 | 635 | // The value of the uninterpreted option, in whatever type the tokenizer 636 | // identified it as during parsing. Exactly one of these should be set. 637 | optional string identifier_value = 3; 638 | optional uint64 positive_int_value = 4; 639 | optional int64 negative_int_value = 5; 640 | optional double double_value = 6; 641 | optional bytes string_value = 7; 642 | optional string aggregate_value = 8; 643 | } 644 | 645 | // =================================================================== 646 | // Optional source code info 647 | 648 | // Encapsulates information about the original source file from which a 649 | // FileDescriptorProto was generated. 650 | message SourceCodeInfo { 651 | // A Location identifies a piece of source code in a .proto file which 652 | // corresponds to a particular definition. This information is intended 653 | // to be useful to IDEs, code indexers, documentation generators, and similar 654 | // tools. 655 | // 656 | // For example, say we have a file like: 657 | // message Foo { 658 | // optional string foo = 1; 659 | // } 660 | // Let's look at just the field definition: 661 | // optional string foo = 1; 662 | // ^ ^^ ^^ ^ ^^^ 663 | // a bc de f ghi 664 | // We have the following locations: 665 | // span path represents 666 | // [a,i) [ 4, 0, 2, 0 ] The whole field definition. 667 | // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). 668 | // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). 669 | // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). 670 | // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). 671 | // 672 | // Notes: 673 | // - A location may refer to a repeated field itself (i.e. not to any 674 | // particular index within it). This is used whenever a set of elements are 675 | // logically enclosed in a single code segment. For example, an entire 676 | // extend block (possibly containing multiple extension definitions) will 677 | // have an outer location whose path refers to the "extensions" repeated 678 | // field without an index. 679 | // - Multiple locations may have the same path. This happens when a single 680 | // logical declaration is spread out across multiple places. The most 681 | // obvious example is the "extend" block again -- there may be multiple 682 | // extend blocks in the same scope, each of which will have the same path. 683 | // - A location's span is not always a subset of its parent's span. For 684 | // example, the "extendee" of an extension declaration appears at the 685 | // beginning of the "extend" block and is shared by all extensions within 686 | // the block. 687 | // - Just because a location's span is a subset of some other location's span 688 | // does not mean that it is a descendent. For example, a "group" defines 689 | // both a type and a field in a single declaration. Thus, the locations 690 | // corresponding to the type and field and their components will overlap. 691 | // - Code which tries to interpret locations should probably be designed to 692 | // ignore those that it doesn't understand, as more types of locations could 693 | // be recorded in the future. 694 | repeated Location location = 1; 695 | message Location { 696 | // Identifies which part of the FileDescriptorProto was defined at this 697 | // location. 698 | // 699 | // Each element is a field number or an index. They form a path from 700 | // the root FileDescriptorProto to the place where the definition. For 701 | // example, this path: 702 | // [ 4, 3, 2, 7, 1 ] 703 | // refers to: 704 | // file.message_type(3) // 4, 3 705 | // .field(7) // 2, 7 706 | // .name() // 1 707 | // This is because FileDescriptorProto.message_type has field number 4: 708 | // repeated DescriptorProto message_type = 4; 709 | // and DescriptorProto.field has field number 2: 710 | // repeated FieldDescriptorProto field = 2; 711 | // and FieldDescriptorProto.name has field number 1: 712 | // optional string name = 1; 713 | // 714 | // Thus, the above path gives the location of a field name. If we removed 715 | // the last element: 716 | // [ 4, 3, 2, 7 ] 717 | // this path refers to the whole field declaration (from the beginning 718 | // of the label to the terminating semicolon). 719 | repeated int32 path = 1 [packed=true]; 720 | 721 | // Always has exactly three or four elements: start line, start column, 722 | // end line (optional, otherwise assumed same as start line), end column. 723 | // These are packed into a single field for efficiency. Note that line 724 | // and column numbers are zero-based -- typically you will want to add 725 | // 1 to each before displaying to a user. 726 | repeated int32 span = 2 [packed=true]; 727 | 728 | // If this SourceCodeInfo represents a complete declaration, these are any 729 | // comments appearing before and after the declaration which appear to be 730 | // attached to the declaration. 731 | // 732 | // A series of line comments appearing on consecutive lines, with no other 733 | // tokens appearing on those lines, will be treated as a single comment. 734 | // 735 | // leading_detached_comments will keep paragraphs of comments that appear 736 | // before (but not connected to) the current element. Each paragraph, 737 | // separated by empty lines, will be one comment element in the repeated 738 | // field. 739 | // 740 | // Only the comment content is provided; comment markers (e.g. //) are 741 | // stripped out. For block comments, leading whitespace and an asterisk 742 | // will be stripped from the beginning of each line other than the first. 743 | // Newlines are included in the output. 744 | // 745 | // Examples: 746 | // 747 | // optional int32 foo = 1; // Comment attached to foo. 748 | // // Comment attached to bar. 749 | // optional int32 bar = 2; 750 | // 751 | // optional string baz = 3; 752 | // // Comment attached to baz. 753 | // // Another line attached to baz. 754 | // 755 | // // Comment attached to qux. 756 | // // 757 | // // Another line attached to qux. 758 | // optional double qux = 4; 759 | // 760 | // // Detached comment for corge. This is not leading or trailing comments 761 | // // to qux or corge because there are blank lines separating it from 762 | // // both. 763 | // 764 | // // Detached comment for corge paragraph 2. 765 | // 766 | // optional string corge = 5; 767 | // /* Block comment attached 768 | // * to corge. Leading asterisks 769 | // * will be removed. */ 770 | // /* Block comment attached to 771 | // * grault. */ 772 | // optional int32 grault = 6; 773 | // 774 | // // ignored detached comments. 775 | optional string leading_comments = 3; 776 | optional string trailing_comments = 4; 777 | repeated string leading_detached_comments = 6; 778 | } 779 | } 780 | 781 | // Describes the relationship between generated code and its original source 782 | // file. A GeneratedCodeInfo message is associated with only one generated 783 | // source file, but may contain references to different source .proto files. 784 | message GeneratedCodeInfo { 785 | // An Annotation connects some span of text in generated code to an element 786 | // of its generating .proto file. 787 | repeated Annotation annotation = 1; 788 | message Annotation { 789 | // Identifies the element in the original source .proto file. This field 790 | // is formatted the same as SourceCodeInfo.Location.path. 791 | repeated int32 path = 1 [packed=true]; 792 | 793 | // Identifies the filesystem path to the original source .proto. 794 | optional string source_file = 2; 795 | 796 | // Identifies the starting offset in bytes in the generated code 797 | // that relates to the identified object. 798 | optional int32 begin = 3; 799 | 800 | // Identifies the ending offset in bytes in the generated code that 801 | // relates to the identified offset. The end offset should be one past 802 | // the last relevant byte (so the length of the text = end - begin). 803 | optional int32 end = 4; 804 | } 805 | } 806 | --------------------------------------------------------------------------------