repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/networking/runner.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/networking/runner.py
import logging import struct from asyncio import ( IncompleteReadError, Lock, StreamReader, StreamWriter, open_connection, ) from multiprocessing.synchronize import Event as EventClass from typing import Any, cast import aioprocessing from client.game.utils import sleep from shared.gen.messages.v1...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/networking/network.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/networking/network.py
import threading import uuid from asyncio import Lock, Queue, Task, create_task, iscoroutinefunction from asyncio.exceptions import IncompleteReadError from datetime import datetime from typing import Any, Awaitable, Callable, Dict, Tuple, TypeVar, cast import aioprocessing import betterproto from client.game.state i...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/networking/__init__.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/networking/__init__.py
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/nearest_sprite.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/nearest_sprite.py
from typing import Tuple, TypedDict import pyglet from pyglet import graphics from pyglet.gl import ( GL_CLAMP_TO_EDGE, GL_NEAREST, GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA, GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_TRIANGL...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/state.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/state.py
import threading import time from datetime import datetime from types import TracebackType from typing import Dict, Tuple, cast import client from client.game.entities.enemy import Enemy from client.scenes.game import Game from shared.constants import TARGET_FPS, TARGET_UPS from shared.gen.messages.v1 import LoggedIn,...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/configuration.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/configuration.py
import os from dataclasses import dataclass, field @dataclass class Configuration: host: str = field( default_factory=lambda: os.environ.get("SERVER_HOST", "localhost") ) port: str = field(default_factory=lambda: os.environ.get("SERVER_PORT", "31337"))
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/area.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/area.py
from dataclasses import dataclass from typing import TYPE_CHECKING, cast import client from client.game.entities.entity import Direction from shared.gen.messages.v1 import Interact, InteractStatus, InteractType, Polygon if TYPE_CHECKING: from client.scenes.game import Game @dataclass class Area: uuid: str ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/camera.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/camera.py
from types import TracebackType from typing import Optional, Tuple, Type import pyglet from pyglet.gl import ( GL_DEPTH_BUFFER_BIT, GL_EQUAL, GL_FALSE, GL_KEEP, GL_NEVER, GL_REPLACE, GL_STENCIL_BUFFER_BIT, GL_STENCIL_TEST, GL_TRUE, glClear, glColorMask, glDepthMask, ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/utils.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/utils.py
import asyncio import time from asyncio import get_running_loop from time import sleep as time_sleep import pyglet import client from shared.constants import TARGET_FPS, TARGET_UPS if pyglet.compat_platform in ["win32", "cygwin"]: async def sleep(delay: float): await get_running_loop().run_in_executor(N...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/sound_manager.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/sound_manager.py
import pyglet class SoundManager: def __init__(self) -> None: self.player = pyglet.media.Player() self.bg_music = None pass def set_background_music(self, path: str) -> None: self.bg_music = pyglet.resource.media(path) self.player.queue(self.bg_music) pass ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/map.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/map.py
from __future__ import annotations import logging import time from asyncio import Lock, PriorityQueue from copy import copy from dataclasses import dataclass from datetime import datetime, timedelta from functools import cache from typing import TYPE_CHECKING, List, cast from shared.constants import CHUNK_SIZE_X, CHU...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/pickupable.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/pickupable.py
from dataclasses import dataclass from typing import Any, cast from pyglet.image import Texture from client.game.entities.entity import ServerManagedEntity from client.game.nearest_sprite import NearestSprite from client.game.ui import get_ui_grid from shared.gen.messages.v1 import Item @dataclass class Pickupable(...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/entities/npc.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/entities/npc.py
from dataclasses import dataclass from typing import TYPE_CHECKING, Any, cast from pyglet import shapes import client from client.game.entities.entity import ( Direction, InteractEntity, NamedEntity, ServerManagedEntity, TilesetEntity, ) from shared.constants import SERVER_TICK_RATE from shared.ge...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/entities/renderable.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/entities/renderable.py
from dataclasses import dataclass @dataclass class Renderable: is_loaded: bool is_ready: bool def __init__(self) -> None: self.is_ready = False self.is_loaded = False def on_load(self) -> None: pass def update(self, dt: float) -> None: pass def draw(self) ->...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/entities/other_player.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/entities/other_player.py
from dataclasses import dataclass from typing import Any import client from client.game.entities.entity import ( Direction, NamedEntity, ServerManagedEntity, TilesetEntity, ) from shared.gen.messages.v1 import Activity @dataclass class OtherPlayer(TilesetEntity, NamedEntity, ServerManagedEntity): ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/entities/entity.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/entities/entity.py
from collections import defaultdict from dataclasses import dataclass from enum import IntEnum from typing import TYPE_CHECKING, Dict, Tuple, cast from pyglet import shapes from pyglet.graphics import Batch from pyglet.image import Animation, AnimationFrame, ImageData, ImageGrid, TextureGrid from pyglet.math import Ma...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/entities/player.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/entities/player.py
import time from dataclasses import dataclass from datetime import datetime from typing import TYPE_CHECKING, Dict, List, cast from pyglet import shapes from pyglet.window import key import client from client.game.entities.enemy import Enemy from client.game.entities.entity import Direction, InteractEntity, TilesetEn...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/entities/enemy.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/entities/enemy.py
import time from dataclasses import dataclass from typing import Any from pyglet import shapes import client from client.game.entities.entity import ( InteractEntity, NamedEntity, ServerManagedEntity, TilesetEntity, ) from shared.constants import SERVER_TICK_RATE from shared.gen.messages.v1 import Act...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/dialog.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/dialog.py
from typing import Callable, cast from pyglet import clock from pyglet.graphics import Batch from pyglet.gui.widgets import WidgetBase from pyglet.image import Texture from pyglet.text.document import FormattedDocument from pyglet.text.layout import TextLayout, _Line # pyright: ignore[reportPrivateUsage] from client...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/input.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/input.py
import inspect from typing import Any, cast import pyperclip from pyglet.graphics import Batch, Group from pyglet.gui import TextEntry from pyglet.text.document import AbstractDocument from pyglet.window.key import MOTION_COPY, MOTION_PASTE from client import MOTION_DELETE_REST, MOTION_SELECT_ALL from client.game.ui....
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/slider.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/slider.py
from typing import cast from pyglet.graphics import Batch, Group from pyglet.gui.widgets import WidgetBase from pyglet.image import Texture from client.game.nearest_sprite import NearestSprite from client.game.ui import get_ui_grid from client.game.ui.tilebox import TileStrip class Slider(WidgetBase): def __ini...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/utils.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/utils.py
from typing import Callable, cast from pyglet.graphics import Batch, Group from pyglet.gui import Frame from pyglet.image import Animation from client.game.ui import get_ui_grid from client.game.ui.button import ImageButton from client.game.ui.tilebox import TileBox class Exit(Group): height: int = 32 * 3 ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/tilebox.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/tilebox.py
import logging from functools import cache from pyglet.gl import ( GL_BLEND, GL_CLAMP_TO_EDGE, GL_NEAREST, GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA, GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_TRIANGLES, glBlendFunc, ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/__init__.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/__init__.py
from functools import cache from pathlib import Path from typing import cast import pyglet from pyglet.image import ImageData, TextureGrid import client @cache def get_ui_image() -> ImageData: return cast( ImageData, pyglet.image.load(Path(client.PATH, "assets/ui/16x16/Modern_UI_Style_1.png")), ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/dropdown.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/dropdown.py
from typing import cast from pyglet.graphics import Batch, Group from pyglet.gui.widgets import WidgetBase from pyglet.shapes import Rectangle from pyglet.text import Label class DropdownEntry(WidgetBase): def __init__(self, x: int, y: int, text: str, batch: Batch, group: Group): padding = 0 self...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/button.py
ctfs/CCCamp/2023/game/Cheat_Code/src/client/client/game/ui/button.py
from typing import cast from pyglet.graphics import Batch, Group from pyglet.gui.widgets import WidgetBase from pyglet.image import Animation, AnimationFrame, Texture from pyglet.text import Label from client.game.nearest_sprite import NearestSprite from client.game.ui.tilebox import TileStrip class ButtonBase(Widg...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/constants.py
ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/constants.py
CHUNK_SIZE_X: int = 32 CHUNK_SIZE_Y: int = 32 TILE_SIZE_X: int = 16 TILE_SIZE_Y: int = 16 NUM_TILES_PER_COLUM: int = 16 PLAYER_SPEED: int = 100 PLAYER_WIDTH: int = 16 PLAYER_HEIGHT: int = 16 PLAYER_DEATH_TIMEOUT = 60 * 5 # 5 minutes VIEW_DISTANCE: int = 500 VIEW_DISTANCE_SQ: int = pow(VIEW_DISTANCE, 2) SERVER_TICK...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/collison.py
ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/collison.py
import functools import operator from typing import Iterator, Tuple import collision from shared.gen.messages.v1 import Polygon from shared.map import Map def bb(x: float, y: float, w: float, h: float) -> Iterator[Tuple[float, float]]: yield x, y yield x + w, y yield x + w, y + h yield x, y + h ca...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/lazy.py
ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/lazy.py
import builtins from collections.abc import Iterator from enum import EnumMeta from typing import Any import betterproto class Lazy: cls: type def __init__(self, cls: type) -> None: self.cls = cls def get_default(self, sub_cls: type) -> Any: match sub_cls: case builtins.str:...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/bidict.py
ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/bidict.py
from __future__ import annotations from typing import Generic, TypeVar _KT = TypeVar("_KT") _VT = TypeVar("_VT") class BijectionError(Exception, Generic[_VT]): """Must set a unique value in a BijectiveMap.""" def __init__(self, value: _VT) -> None: self.value = value msg = 'The value "{}" i...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/utils.py
ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/utils.py
from __future__ import annotations from asyncio import Lock from threading import Timer from typing import Any, Awaitable, Callable, List class AsyncLockEventHandler(object): lock: Lock def __init__( self, handlers: List[Callable[[Lock, *Any], Awaitable[None]]] | None = None ) -> None: s...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/__init__.py
ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/__init__.py
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/map.py
ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/map.py
from abc import ABC, abstractmethod from dataclasses import dataclass from typing import List, Tuple from shared.gen.messages.v1 import Polygon @dataclass class Tile: chunk_atlas_offset: int collision: List[Polygon] class Map(ABC): @abstractmethod def get_tiles( self, x: float, y: float, us...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/gen/__init__.py
ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/gen/__init__.py
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/gen/messages/__init__.py
ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/gen/messages/__init__.py
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/gen/messages/v1/__init__.py
ctfs/CCCamp/2023/game/Cheat_Code/src/shared/shared/gen/messages/v1/__init__.py
# Generated by the protocol buffer compiler. DO NOT EDIT! # sources: messages/v1/entity.proto, messages/v1/messages.proto, messages/v1/tile.proto # plugin: python-betterproto # This file has been @generated from dataclasses import dataclass from datetime import datetime from typing import List import betterproto c...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/server_runner.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/server_runner.py
from __future__ import annotations import struct import time import traceback from asyncio import ( Queue, StreamReader, StreamWriter, as_completed, create_task, sleep, start_server, ) from copy import deepcopy from datetime import datetime, timedelta from threading import Event from typing...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/models.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/models.py
from dataclasses import dataclass, field from datetime import datetime, timedelta from typing import Any from shared.gen.messages.v1 import Coords, MapChunk, SessionType @dataclass class Position: coords: Coords time: datetime @dataclass class Session: type: SessionType = field(default=SessionType.SESS...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/main.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/main.py
import argparse import logging import os import sys import tempfile from asyncio import get_event_loop from concurrent.futures import ProcessPoolExecutor from datetime import datetime from threading import Event from typing import cast import dill from rpyc.core import SlaveService from rpyc.utils.server import Thread...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/__init__.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/__init__.py
from concurrent.futures import ProcessPoolExecutor from pathlib import Path from server.game.state import Game from server.server_runner import Server game_state: Game global_server: Server executor: ProcessPoolExecutor PATH = Path(__file__).parent
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/fight.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/fight.py
import time from typing import Dict from server.game.entity.enemy import Enemy from shared.constants import SERVER_TICK_RATE from shared.gen.messages.v1 import AttackEnemy, User class FightManager: user_damage_cooldowns: Dict[str, float] enemy_damage_cooldowns: Dict[str, float] def __init__(self) -> Non...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/state.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/state.py
import json import math import time from collections import defaultdict from copy import deepcopy from datetime import datetime, timedelta from pathlib import Path from typing import Any, Dict, List, Literal, cast from aiochclient import ChClient from aiohttp import ClientSession from aiohttp_retry import ExponentialR...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/__init__.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/__init__.py
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/secret.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/secret.py
from shared.gen.messages.v1 import Item ITEMS = { "shovel": Item(name="Shovel", description="DIGGY DIGGY", quantity=1, icon=2501), "flag_dig": Item( name="Dig Flag", description=" ALLES!{REDACTED}", quantity=1, icon=2562, ), "flag_runner": Item( name="Runner Flag...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/auth.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/auth.py
import json from pathlib import Path from shared.gen.messages.v1 import SessionType auth_path: str def auth(username: str, password: str) -> SessionType | None: with open(Path(auth_path), "r") as f: users = json.load(f) for u, p in users["users"].items(): if username[:-1] == u and username[...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/statemachine.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/statemachine.py
from dataclasses import dataclass from typing import Dict STATE_CONTINUE = "STATE_CONTINUE" @dataclass class BaseState: DEBUG = False name: str parameter: object def __init__(self, name: str = "none", param: object = None): self.name = name self.parameter = param def enter(self)...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/npc.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/npc.py
import json import logging import math import random from copy import copy from dataclasses import dataclass from datetime import timedelta from pathlib import Path from typing import Any, List, Tuple, cast import server from server.game.entity.dino_runner import Engine from server.game.entity.object import Object fro...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/dino_runner.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/dino_runner.py
import random from collections import defaultdict from shared.constants import TARGET_UPS from shared.gen.messages.v1 import Runner, RunnerAction class Obstacle: x: float = 0 width: float height: float class SmallObstacle(Obstacle): width = 17 height = 35 class BigObstacle(Obstacle): widt...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/area.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/area.py
import math import operator import random import uuid from dataclasses import dataclass from functools import reduce from typing import Any import server from server.game.entity.object import Object as EntityObject from server.game.entity.pickupable import Pickupable from server.game.map.properties import CustomIntera...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/object.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/object.py
from dataclasses import dataclass from uuid import uuid4 from shared.gen.messages.v1 import Coords from shared.gen.messages.v1 import Object as ObjectProto from shared.gen.messages.v1 import ObjectType @dataclass(kw_only=True) class Object: name: str type: ObjectType def __init__( self, ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/__init__.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/__init__.py
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/enemy.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/enemy.py
import math import sys import time from dataclasses import dataclass from typing import Any, cast import server from server.game.entity.npc import NPCPath from server.game.entity.object import Object from server.game.entity.statemachine import STATE_CONTINUE, BaseState, StateMachine from server.game.secret import ITEM...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/pickupable.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/entity/pickupable.py
from dataclasses import dataclass from typing import Any import server from server.game.entity.object import Object from shared.gen.messages.v1 import Item from shared.gen.messages.v1 import Object as ObjectProto from shared.gen.messages.v1 import Object as ProtoObject from shared.gen.messages.v1 import Objects, Objec...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/map/properties.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/map/properties.py
from dataclasses import dataclass, field from enum import Enum from typing import Any, NewType from dataclasses_jsonschema import JsonSchemaMixin from dataclasses_jsonschema.field_types import FieldEncoder ObjectType = NewType("ObjectType", int) class ObjectTypeField(FieldEncoder[int, int]): @property def j...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/map/__init__.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/map/__init__.py
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/map/map.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/game/map/map.py
from __future__ import annotations import logging from functools import cache from pathlib import Path from typing import Any, Dict, List, Tuple, cast import numpy as np import pytiled_parser from mazelib import Maze from mazelib.generate.DungeonRooms import DungeonRooms from PIL import Image from pytiled_parser impo...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/map/merge_dino_tileset.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/map/merge_dino_tileset.py
from PIL import Image import sys import glob TILE_SIZE = 24 if len(sys.argv) < 2: print("Usage: merge_dino_tileset.py <path_to_to_dino>") print("Example: merge_dino_tileset.py assets/dinos/male/mono") exit(-1) base_path = sys.argv[1] + "/base/" images = sorted(glob.glob(base_path + "*.*")) print(f"Found...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/map/generate_properties.py
ctfs/CCCamp/2023/game/Dino_Runner/src/server/server/map/generate_properties.py
import hashlib import json from typing import Any from dataclasses_jsonschema import JsonSchemaMixin from server.game.map.properties import * # type: ignore def get_class(name: str, properties: dict[str, Any]) -> dict[str, dict[str, Any]]: m = hashlib.md5() m.update(name.encode()) id = int(m.hexdigest(...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/main.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/main.py
import argparse import asyncio import logging import multiprocessing import sys import threading import traceback from multiprocessing.synchronize import Event as MultiprocessingEventClass import aioprocessing import pyglet import client from client.game.state import GameState from client.networking.network import Co...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/__init__.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/__init__.py
MOTION_SELECT_ALL = 0xFF MOTION_DELETE_REST = 0xFE from pathlib import Path import pyglet from pyglet.window import key from client.game.state import GameState from client.networking.network import Connection from client.scenes.scenemanager import SceneManager if hasattr(pyglet.window, "xlib"): pyglet.window.xl...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/inventory.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/inventory.py
from typing import TYPE_CHECKING, Callable, cast from pyglet.gl import GL_SCISSOR_TEST, glDisable, glEnable, glScissor from pyglet.graphics import Batch, Group from pyglet.gui import Frame from pyglet.image import Animation, Texture from pyglet.text import Label from pyglet.window import Window import client from cli...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/dialog.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/dialog.py
from pyglet.graphics import Batch from pyglet.gui import Frame from pyglet.window import Window from client.game.ui.dialog import Dialog, DialogCallback from client.scenes.scenemanager import Scene class DialogScene(Scene): def __init__( self, window: Window, ) -> None: super().__init...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/game_over.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/game_over.py
from pathlib import Path from typing import cast from pyglet import image from pyglet.graphics import Batch from pyglet.gui import Frame from pyglet.image import ImageData from pyglet.sprite import Sprite from pyglet.text import Label from pyglet.window import Window import client from client.scenes.scenemanager impo...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/dino_runner.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/dino_runner.py
import random from collections import defaultdict from functools import cache from pathlib import Path from typing import cast import pyglet from pyglet.graphics import Batch from pyglet.gui import Frame from pyglet.image import ImageData from pyglet.text import Label from pyglet.window import Window from pyglet.windo...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/input.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/input.py
from typing import TYPE_CHECKING, Callable, cast from pyglet.graphics import Batch from pyglet.window import Window from pyglet.window.key import ENTER import client from client.game.ui.input import TextInput from client.scenes.scenemanager import Scene if TYPE_CHECKING: from client.scenes.game import Game Inpu...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/shop.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/shop.py
from typing import TYPE_CHECKING, Callable, cast from pyglet.gl import GL_SCISSOR_TEST, glDisable, glEnable, glScissor from pyglet.graphics import Batch, Group from pyglet.gui import Frame from pyglet.image import Animation, Texture from pyglet.text import Label from pyglet.window import Window import client from cli...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/scenemanager.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/scenemanager.py
from __future__ import annotations import time from abc import ABC, abstractmethod from pyglet.input import Controller, ControllerManager from pyglet.window import Window, key import client from shared.constants import TARGET_FPS, TARGET_UPS class Scene(ABC): _sub_scenes: dict[str, Scene] _current_sub_scen...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/hud.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/hud.py
from typing import TYPE_CHECKING, cast from pyglet.graphics import Batch, Group from pyglet.gui import Frame from pyglet.image import Animation, Texture from pyglet.text import Label from pyglet.window import Window import client from client.game.nearest_sprite import NearestSprite from client.game.ui import get_ui_g...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/__init__.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/__init__.py
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/intro.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/intro.py
from pathlib import Path from typing import cast from pyglet import image from pyglet.graphics import Batch from pyglet.gui import Frame from pyglet.image import ImageData from pyglet.sprite import Sprite from pyglet.text import Label from pyglet.window import Window import client from client.scenes.scenemanager impo...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/globals.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/globals.py
from pyglet.text import Label from pyglet.window import FPSDisplay, Window from client.scenes.scenemanager import Scene from shared.gen.messages.v1 import Error, ErrorType class Globals(Scene): error_message: str def __init__(self, window: Window) -> None: super().__init__(window) self.fps_d...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/test.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/test.py
from pyglet.graphics import Batch from pyglet.gui import Frame from pyglet.window import Window from client.game.ui.button import TextButton from client.game.ui.dialog import Dialog from client.game.ui.dropdown import Dropdown from client.game.ui.input import PasswordInput from client.scenes.scenemanager import Scene ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/game.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/game.py
from datetime import datetime, timedelta from itertools import chain from typing import Callable, Dict, cast from pyglet.event import EVENT_HANDLED from pyglet.graphics import Batch from pyglet.gui import Frame from pyglet.window import Window from pyglet.window.key import ESCAPE, SPACE import client from client.game...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/mainmenu.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/scenes/mainmenu.py
from pathlib import Path from typing import cast from pyglet import image from pyglet.graphics import Batch from pyglet.gui import Frame from pyglet.image import ImageData from pyglet.sprite import Sprite from pyglet.text import Label from pyglet.window import Window import client from client.game.ui.button import Te...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/networking/runner.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/networking/runner.py
import logging import struct from asyncio import ( IncompleteReadError, Lock, StreamReader, StreamWriter, open_connection, ) from multiprocessing.synchronize import Event as EventClass from typing import Any, cast import aioprocessing from client.game.utils import sleep from shared.gen.messages.v1...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/networking/network.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/networking/network.py
import threading import uuid from asyncio import Lock, Queue, Task, create_task, iscoroutinefunction from asyncio.exceptions import IncompleteReadError from datetime import datetime from typing import Any, Awaitable, Callable, Dict, Tuple, TypeVar, cast import aioprocessing import betterproto from client.game.state i...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/networking/__init__.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/networking/__init__.py
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/nearest_sprite.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/nearest_sprite.py
from typing import Tuple, TypedDict import pyglet from pyglet import graphics from pyglet.gl import ( GL_CLAMP_TO_EDGE, GL_NEAREST, GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA, GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_TRIANGL...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/state.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/state.py
import threading import time from datetime import datetime from types import TracebackType from typing import Dict, Tuple, cast import client from client.game.entities.enemy import Enemy from client.scenes.game import Game from shared.constants import TARGET_FPS, TARGET_UPS from shared.gen.messages.v1 import LoggedIn,...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/configuration.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/configuration.py
import os from dataclasses import dataclass, field @dataclass class Configuration: host: str = field( default_factory=lambda: os.environ.get("SERVER_HOST", "localhost") ) port: str = field(default_factory=lambda: os.environ.get("SERVER_PORT", "31337"))
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/area.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/area.py
from dataclasses import dataclass from typing import TYPE_CHECKING, cast import client from client.game.entities.entity import Direction from shared.gen.messages.v1 import Interact, InteractStatus, InteractType, Polygon if TYPE_CHECKING: from client.scenes.game import Game @dataclass class Area: uuid: str ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/camera.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/camera.py
from types import TracebackType from typing import Optional, Tuple, Type import pyglet from pyglet.gl import ( GL_DEPTH_BUFFER_BIT, GL_EQUAL, GL_FALSE, GL_KEEP, GL_NEVER, GL_REPLACE, GL_STENCIL_BUFFER_BIT, GL_STENCIL_TEST, GL_TRUE, glClear, glColorMask, glDepthMask, ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/utils.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/utils.py
import asyncio import time from asyncio import get_running_loop from time import sleep as time_sleep import pyglet import client from shared.constants import TARGET_FPS, TARGET_UPS if pyglet.compat_platform in ["win32", "cygwin"]: async def sleep(delay: float): await get_running_loop().run_in_executor(N...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/sound_manager.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/sound_manager.py
import pyglet class SoundManager: def __init__(self) -> None: self.player = pyglet.media.Player() self.bg_music = None pass def set_background_music(self, path: str) -> None: self.bg_music = pyglet.resource.media(path) self.player.queue(self.bg_music) pass ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/map.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/map.py
from __future__ import annotations import logging import time from asyncio import Lock, PriorityQueue from copy import copy from dataclasses import dataclass from datetime import datetime, timedelta from functools import cache from typing import TYPE_CHECKING, List, cast from shared.constants import CHUNK_SIZE_X, CHU...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/pickupable.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/pickupable.py
from dataclasses import dataclass from typing import Any, cast from pyglet.image import Texture from client.game.entities.entity import ServerManagedEntity from client.game.nearest_sprite import NearestSprite from client.game.ui import get_ui_grid from shared.gen.messages.v1 import Item @dataclass class Pickupable(...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/entities/npc.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/entities/npc.py
from dataclasses import dataclass from typing import TYPE_CHECKING, Any, cast from pyglet import shapes import client from client.game.entities.entity import ( Direction, InteractEntity, NamedEntity, ServerManagedEntity, TilesetEntity, ) from shared.constants import SERVER_TICK_RATE from shared.ge...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/entities/renderable.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/entities/renderable.py
from dataclasses import dataclass @dataclass class Renderable: is_loaded: bool is_ready: bool def __init__(self) -> None: self.is_ready = False self.is_loaded = False def on_load(self) -> None: pass def update(self, dt: float) -> None: pass def draw(self) ->...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/entities/other_player.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/entities/other_player.py
from dataclasses import dataclass from typing import Any import client from client.game.entities.entity import ( Direction, NamedEntity, ServerManagedEntity, TilesetEntity, ) from shared.gen.messages.v1 import Activity @dataclass class OtherPlayer(TilesetEntity, NamedEntity, ServerManagedEntity): ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/entities/entity.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/entities/entity.py
from collections import defaultdict from dataclasses import dataclass from enum import IntEnum from typing import TYPE_CHECKING, Dict, Tuple, cast from pyglet import shapes from pyglet.graphics import Batch from pyglet.image import Animation, AnimationFrame, ImageData, ImageGrid, TextureGrid from pyglet.math import Ma...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/entities/player.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/entities/player.py
import time from dataclasses import dataclass from datetime import datetime from typing import TYPE_CHECKING, Dict, List, cast from pyglet import shapes from pyglet.window import key import client from client.game.entities.enemy import Enemy from client.game.entities.entity import Direction, InteractEntity, TilesetEn...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/entities/enemy.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/entities/enemy.py
import time from dataclasses import dataclass from typing import Any from pyglet import shapes import client from client.game.entities.entity import ( InteractEntity, NamedEntity, ServerManagedEntity, TilesetEntity, ) from shared.constants import SERVER_TICK_RATE from shared.gen.messages.v1 import Act...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/dialog.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/dialog.py
from typing import Callable, cast from pyglet import clock from pyglet.graphics import Batch from pyglet.gui.widgets import WidgetBase from pyglet.image import Texture from pyglet.text.document import FormattedDocument from pyglet.text.layout import TextLayout, _Line # pyright: ignore[reportPrivateUsage] from client...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/input.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/input.py
import inspect from typing import Any, cast import pyperclip from pyglet.graphics import Batch, Group from pyglet.gui import TextEntry from pyglet.text.document import AbstractDocument from pyglet.window.key import MOTION_COPY, MOTION_PASTE from client import MOTION_DELETE_REST, MOTION_SELECT_ALL from client.game.ui....
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/slider.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/slider.py
from typing import cast from pyglet.graphics import Batch, Group from pyglet.gui.widgets import WidgetBase from pyglet.image import Texture from client.game.nearest_sprite import NearestSprite from client.game.ui import get_ui_grid from client.game.ui.tilebox import TileStrip class Slider(WidgetBase): def __ini...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/utils.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/utils.py
from typing import Callable, cast from pyglet.graphics import Batch, Group from pyglet.gui import Frame from pyglet.image import Animation from client.game.ui import get_ui_grid from client.game.ui.button import ImageButton from client.game.ui.tilebox import TileBox class Exit(Group): height: int = 32 * 3 ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/tilebox.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/tilebox.py
import logging from functools import cache from pyglet.gl import ( GL_BLEND, GL_CLAMP_TO_EDGE, GL_NEAREST, GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA, GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_TRIANGLES, glBlendFunc, ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/__init__.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/__init__.py
from functools import cache from pathlib import Path from typing import cast import pyglet from pyglet.image import ImageData, TextureGrid import client @cache def get_ui_image() -> ImageData: return cast( ImageData, pyglet.image.load(Path(client.PATH, "assets/ui/16x16/Modern_UI_Style_1.png")), ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/dropdown.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/dropdown.py
from typing import cast from pyglet.graphics import Batch, Group from pyglet.gui.widgets import WidgetBase from pyglet.shapes import Rectangle from pyglet.text import Label class DropdownEntry(WidgetBase): def __init__(self, x: int, y: int, text: str, batch: Batch, group: Group): padding = 0 self...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/button.py
ctfs/CCCamp/2023/game/Dino_Runner/src/client/client/game/ui/button.py
from typing import cast from pyglet.graphics import Batch, Group from pyglet.gui.widgets import WidgetBase from pyglet.image import Animation, AnimationFrame, Texture from pyglet.text import Label from client.game.nearest_sprite import NearestSprite from client.game.ui.tilebox import TileStrip class ButtonBase(Widg...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false